Code Monkey home page Code Monkey logo

brahman's Introduction

brahman (ब्रह्मन्)

It is written as an extendable library for building DNS Balancer/Server.
Running it is pretty simple:

  • Start the brahman app
  • Implement a socket server(using :gen_udp or netlink)
  • Implement a handler function
  • Call Brahman.Dns.Handler.handle/2

Overview

Querying

Aims to make it as easy as possible to build DNS LB/Server.

iex> packet = File.read!("test/packet_data/dns_query.raw")
iex> handler_fn = &IO.inspect/1
iex> Brahman.Dns.Handler.handle(packet, handler_fn)

The handler_fn is a higher order function or form of {function(), [:args]}.

Zone Interfaces

  • Brahman.Dns.Zones.put/2

    name = "example.com"
    
    records = [
      %{
        name: "dummy1.example.com",
        type: "A",
        ttl: 3600,
        data: %{ip: "192.168.5.1"}
      },
      %{
        name: "dummy2.example.com",
        type: "A",
        ttl: 3600,
        data: %{ip: "192.168.5.2"}
      },
      %{
        name: "dummy3.example.com",
        type: "A",
        ttl: 3600,
        data: %{ip: "192.168.5.3"}
      }
    ]
    
    :ok = Brahman.Dns.Zones.put(name, records)
  • Brahman.Dns.Zones.get/1

    ^records = Brahman.Dns.Zones.get("example.com")
  • Brahman.Dns.Zones.delete/1

    :ok = Brahman.Dns.Zones.delete("example.com")
    [] = Brahman.Dns.Zones.get("example.com")

Status

Under development

License

Tres is released under the SUSHI-WARE LICENSE.

私に寿司をおごってください

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.