json

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServerPath is the HTTP path of the JSON v1 server resource.
	ServerPath = "/json/v1/server"
	// TasksPath is the HTTP path of the JSON v1 tasks resource.
	TasksPath = "/json/v1/tasks"
	// ZonesPath is the HTTP path of the JSON v1 zones resource.
	ZonesPath = "/json/v1/zones"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements bind.Client and can be used to query a BIND JSON v1 API.

func NewClient

func NewClient(url string, c *http.Client) *Client

NewClient returns an initialized Client.

func (*Client) Get

func (c *Client) Get(p string, v interface{}) error

Get queries the given path and stores the result in the value pointed to by v. The endpoint must return a valid JSON representation which can be unmarshaled into the provided value.

func (*Client) Stats

func (c *Client) Stats(groups ...bind.StatisticGroup) (bind.Statistics, error)

Stats implements bind.Stats.

type Counters

type Counters map[string]uint64

type Gauges

type Gauges map[string]uint64

type Statistics

type Statistics struct {
	BootTime   time.Time `json:"boot-time"`
	ConfigTime time.Time `json:"config-time"`
	Opcodes    Counters  `json:"opcodes"`
	QTypes     Counters  `json:"qtypes"`
	NSStats    Counters  `json:"nsstats"`
	Rcodes     Counters  `json:"rcodes"`
	ZoneStats  Counters  `json:"zonestats"`
	Views      map[string]struct {
		Resolver struct {
			Cache  Gauges   `json:"cache"`
			Qtypes Counters `json:"qtypes"`
			Stats  Counters `json:"stats"`
		} `json:"resolver"`
	} `json:"views"`
}

type TaskStatistics

type TaskStatistics struct {
	TaskMgr struct {
		TasksRunning  uint64 `json:"tasks-running"`
		WorkerThreads uint64 `json:"worker-threads"`
	} `json:"taskmgr"`
}

type ZoneStatistics

type ZoneStatistics struct {
	Views map[string]struct {
		Zones []struct {
			Name   string `json:"name"`
			Class  string `json:"class"`
			Serial uint32 `json:"serial"` // RFC 1035 specifies SOA serial number as uint32
		} `json:"zones"`
	} `json:"views"`
}

Jump to

Keyboard shortcuts

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