client

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

client

Go Reference

DNS-over-gRPC client library and CLI command

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides a convenient interface to a gRPC-based DNS service.

func NewClient

func NewClient(endpoint, cert, key, ca string, dialOpts []grpc.DialOption) (*Client, error)

NewClient establishes a connection to a server and returns a pointer to a Client.

func (*Client) Query

func (c *Client) Query(req *dns.Msg) (*dns.Msg, error)

Query performs a query using the gRPC DNS server

func (*Client) QueryNameAndType

func (c *Client) QueryNameAndType(qname string, qtype uint16) (*dns.Msg, error)

QueryNameAndType is a convenience function that queries by name and type, via gRPC.

func (*Client) Watch

func (c *Client) Watch(req *dns.Msg) (*Watch, error)

Watch requests that the server push change notifications to this client for a specific query.

func (*Client) WatchNameAndType

func (c *Client) WatchNameAndType(qname string, qtype uint16) (*Watch, error)

WatchNameAndType is a convenience function to setup a watch by name and type.

type Msg

type Msg struct {
	Msg *dns.Msg
	Err string
	End bool
}

Msg holds a message from the server

type Watch

type Watch struct {
	WatchID int64
	Msgs    chan *Msg
	// contains filtered or unexported fields
}

Watch is used to track access results from watching a particular query.

func (*Watch) Stop

func (w *Watch) Stop() error

Stop will cancel the watch in the server, so no further updates will be sent for that particular query.

Directories

Path Synopsis
cmd
dnsgrpc command

Jump to

Keyboard shortcuts

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