Documentation
¶
Index ¶
- Variables
- func IsIPv6(addr string) bool
- func PathToSocket() string
- type Client
- func (c *Client) Dialer(ctx context.Context, slug string) (d Dialer, err error)
- func (c *Client) Establish(ctx context.Context, slug string) (res *EstablishResponse, err error)
- func (c *Client) Instances(ctx context.Context, org *api.Organization, app string) (instances Instances, err error)
- func (c *Client) Kill(ctx context.Context) error
- func (c *Client) Ping(ctx context.Context) (res PingResponse, err error)
- func (c *Client) Probe(ctx context.Context, slug string) error
- func (c *Client) Resolve(ctx context.Context, slug, host string) (addr string, err error)
- func (c *Client) WaitForHost(parent context.Context, slug, host string) (err error)
- func (c *Client) WaitForTunnel(parent context.Context, slug string) (err error)
- type Dialer
- type EstablishResponse
- type Instances
- type PingResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoSuchHost = errors.New("no such host")
ErrTunnelUnavailable = errors.New("tunnel unavailable")
)
Functions ¶
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) 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 PingResponse ¶ added in v0.0.234
type PingResponse struct {
PID int
Version semver.Version
Background bool
}
Click to show internal directories.
Click to hide internal directories.