client

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetRules returns the rules for this namespace that match the filter.
	GetRules(f rules.Filter) (RuleResponse, error)
}

Client for the controller.

func New

func New(conf Config) (Client, error)

New constructs a new controller client.

type Config

type Config struct {

	// URL of the controller server.
	URL string

	// AuthToken is the token to be used for authentication with the controller.
	// If left empty, no authentication is used.
	AuthToken string

	// HTTPClient can be used to customize the underlying HTTP client behavior,
	// such as enabling TLS, setting timeouts, etc.
	// If left nil, a default HTTP client will be used.
	HTTPClient *http.Client
}

Config stores the configurable attributes of the client.

type RuleResponse

type RuleResponse struct {
	// Rules that matched the filter.
	Rules []rules.Rule `json:"rules"`

	// Revision of the rules for this namespace.
	Revision int64 `json:"revision"`
}

RuleResponse is the information returned from a rule query.

Jump to

Keyboard shortcuts

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