nsink

package module
v0.0.0-...-1abfae5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: MIT Imports: 5 Imported by: 0

README

NSink

WIP

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Total uint
	Trees map[string]uint
}

func NewClient

func NewClient() Client

type Options

type Options struct {
	Ttl   uint32
	Proxy string
	Open  bool
}

type Server

type Server struct {
	Clients   map[string]Client
	Trees     map[string]Tree
	Options   Options
	DnsClient dns.Client
}

func NewServer

func NewServer(options Options) Server

func (Server) DeleteClient

func (s Server) DeleteClient(ip string)

func (Server) DeleteTree

func (s Server) DeleteTree(id string)

func (Server) DeleteTreeAddress

func (s Server) DeleteTreeAddress(id string, name string)

func (Server) GetClient

func (s Server) GetClient(ip string) *Client

func (Server) Listen

func (s Server) Listen(addr string, network string) error

func (Server) Reply

func (s Server) Reply(question dns.Question, client Client) *dns.RR

func (Server) ServeDNS

func (s Server) ServeDNS(writer dns.ResponseWriter, request *dns.Msg)

func (Server) SetClient

func (s Server) SetClient(ip string, ids []string)

func (Server) SetTreeAddress

func (s Server) SetTreeAddress(id string, name string, ip string)

func (Server) SetTreeBlock

func (s Server) SetTreeBlock(id string, name string)

type Tree

type Tree struct {
	Nodes map[string]Tree
	Ip    string
}

func NewTree

func NewTree(ip string) Tree

func NullTree

func NullTree() Tree

func (*Tree) Delete

func (t *Tree) Delete(name string)

func (*Tree) Find

func (t *Tree) Find(name string) *Tree

func (*Tree) FindIP

func (t *Tree) FindIP(name string) string

func (*Tree) Insert

func (t *Tree) Insert(name string, ip string)

func (*Tree) String

func (t *Tree) String(name string, tab int) string

func (*Tree) Traverse

func (t *Tree) Traverse(name string, write bool) *Tree

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL