client

package
v0.0.0-...-ffdcb7f Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: GPL-3.0 Imports: 7 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 struct {
	// contains filtered or unexported fields
}

Client describes a very simple client for connecting to a daemon rest API

func New

func New(address string, options ...Option) (*Client, error)

New creates a Client using the address and certificates.

func (*Client) Info

func (c *Client) Info() Info

Info returns the information result from the daemon API

type Environment

type Environment struct {
	Addresses     []string `json:"addresses" yaml:"addresses"`
	Server        string   `json:"server" yaml:"server"`
	ServerPid     int      `json:"server_pid" yaml:"server_pid"`
	ServerVersion string   `json:"server_version" yaml:"server_version"`
	ServerName    string   `json:"server_name" yaml:"server_name"`
}

Environment defines the server environment for the daemon

type Info

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

Info represents a way of interacting with the daemon API, which is responsible for getting the information from the daemon.

func (Info) Get

func (i Info) Get() (InfoResult, error)

Get returns the information from the daemon API

type InfoResult

type InfoResult struct {
	Environment Environment            `json:"environment" yaml:"environment"`
	Config      map[string]interface{} `json:"config" yaml:"config"`
}

InfoResult contains the result of querying the daemon information API

type Metadata

type Metadata struct {
	ETag     string
	Duration time.Duration
}

Metadata holds the metadata for each result.

type Option

type Option func(*options)

Option to be passed to Connect to customize the resulting instance.

func WithLogger

func WithLogger(logger log.Logger) Option

WithLogger sets the logger on the option

Jump to

Keyboard shortcuts

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