agent

package
v0.0.288 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchHost        = errors.New("no such host")
	ErrTunnelUnavailable = errors.New("tunnel unavailable")
)

Functions

func IsIPv6 added in v0.0.233

func IsIPv6(addr string) bool

func PathToSocket added in v0.0.287

func PathToSocket() string

TODO: deprecate

Types

type Client

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

func DefaultClient

func DefaultClient(ctx context.Context) (*Client, error)

func Dial added in v0.0.287

func Dial(ctx context.Context, network, addr string) (client *Client, err error)

func Establish added in v0.0.233

func Establish(ctx context.Context, apiClient *api.Client) (*Client, error)

Establish starts the daemon, if necessary, and returns a client to it.

func StartDaemon added in v0.0.233

func StartDaemon(ctx context.Context) (*Client, error)

func (*Client) Dialer

func (c *Client) Dialer(ctx context.Context, slug string) (d Dialer, err error)

func (*Client) Establish

func (c *Client) Establish(ctx context.Context, slug string) (res *EstablishResponse, err error)

func (*Client) Instances

func (c *Client) Instances(ctx context.Context, org *api.Organization, app string) (instances Instances, err error)

func (*Client) Kill

func (c *Client) Kill(ctx context.Context) error

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) (res PingResponse, err error)

func (*Client) Probe

func (c *Client) Probe(ctx context.Context, slug string) error

func (*Client) Resolve added in v0.0.233

func (c *Client) Resolve(ctx context.Context, slug, host string) (addr string, err error)

func (*Client) WaitForHost added in v0.0.233

func (c *Client) WaitForHost(ctx context.Context, slug, host string) (err error)

func (*Client) WaitForTunnel added in v0.0.233

func (c *Client) WaitForTunnel(ctx context.Context, slug string) (err error)

type Dialer

type Dialer interface {
	State() *wg.WireGuardState
	Config() *wg.Config
	DialContext(ctx context.Context, network, addr string) (net.Conn, error)
}

TODO: refactor to struct

type EstablishResponse added in v0.0.240

type EstablishResponse struct {
	WireGuardState *wg.WireGuardState
	TunnelConfig   *wg.Config
}

type Instances

type Instances struct {
	Labels    []string
	Addresses []string
}

type PingResponse added in v0.0.234

type PingResponse struct {
	PID        int
	Version    semver.Version
	Background bool
}

Directories

Path Synopsis
internal
proto
Package proto implements the agent's protocol.
Package proto implements the agent's protocol.

Jump to

Keyboard shortcuts

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