input

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Hosts           []NginxHost `yaml:"hosts"`
	ClientTimeout   int         `yaml:"client_timeout"`
	APIEndpoint     string      `yaml:"api_endpoint"`
	Resolver        string      `yaml:"resolver"`
	ResolverTimeout int         `yaml:"resolver_timeout"`
}

Cfg stores the configuration parameters for all the NGINX Plus instances to get the data from

type NginxHost

type NginxHost struct {
	Host       string `yaml:"host"`
	Port       int    `yaml:"port"`
	Resolve    bool   `yaml:"resolve"`
	HostHeader string `yaml:"host_header"`
}

NginxHost stores the information about a remote host of an NGINX Plus instance

func (NginxHost) String

func (nh NginxHost) String() string

type NginxPlus

type NginxPlus struct {
	Cfg         *Cfg
	ClientsPool []*nginx.NginxClient
}

NginxPlus stores the NGINX Plus API client and some internal configuration to fetch data from NGINX

func (*NginxPlus) Configure

func (n *NginxPlus) Configure(cfg *Cfg) error

Configure sets the configuration of the NginxPlus clients

func (*NginxPlus) Fetch

func (n *NginxPlus) Fetch() []*client.Stats

Fetch gets the stats of n NGINX Plus instances

type Resolver

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

Resolver handles the resolution of NGINX Plus IPs using a custom DNS resolver

func NewResolver

func NewResolver(resolver string, timeout int) *Resolver

NewResolver returns a new instance of the Resolver

func (*Resolver) Lookup

func (r *Resolver) Lookup(host string) ([]string, error)

Lookup returns a list of IP Addresses for a given host using the custom resolver. If not resolver defined, the local resolver is used.

type Task

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

Task is a wrapper to store results of fetching multiple NGINX Plus instances

Jump to

Keyboard shortcuts

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