agent

package
v0.0.294 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

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(parent context.Context, slug, host string) (err error)

WaitForHost waits for a tunnel to the given host of the given org slug to become available in the next four minutes.

func (*Client) WaitForTunnel added in v0.0.233

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

WaitForTunnel waits for a tunnel to the given org slug to become available in the next four minutes.

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