Documentation ¶
Index ¶
- func ClientTLSConfig(caCertPEM []byte, certPEM []byte, keyPEM []byte) (*tls.Config, error)
- func HeartbeatFailureExit()
- func HeartbeatFailureShutdown()
- func ServerTLSConfig(caCertPEM []byte, certPEM []byte, keyPEM []byte) (*tls.Config, error)
- type CACert
- type Cert
- type Certs
- type Client
- func (c *Client) Dial(network, addr string) (net.Conn, error)
- func (c *Client) DialContext(ctx context.Context, network, addr string) (net.Conn, error)
- func (c *Client) Fetch(ctx context.Context, url, path string) error
- func (c *Client) ReadFile(ctx context.Context, filePath string) (io.ReadCloser, error)
- func (c *Client) SendFile(ctx context.Context, filePath string, contents io.Reader) error
- func (c *Client) SendHeartbeat(ctx context.Context) error
- func (n *Client) StartHeartbeat()
- func (c *Client) StartProc(ctx context.Context, runReq clusteriface.StartProcRequest) (clusteriface.Process, error)
- func (n *Client) StopHeartbeat()
- func (c *Client) WaitForServer(ctx context.Context) error
- type ClientOption
- type ConnectRequest
- type FetchRequest
- type NodeAgent
- type Option
- type PostCommandRequest
- type PostCommandResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientTLSConfig ¶
func HeartbeatFailureExit ¶
func HeartbeatFailureExit()
func HeartbeatFailureShutdown ¶
func HeartbeatFailureShutdown()
Types ¶
type Cert ¶
type Cert struct { X509Cert *x509.Certificate CertDER []byte CertPEMBytes []byte KeyPEMBytes []byte }
type Certs ¶
Certs contains the TLS client and server certs and keys for configuring mTLS on the client and server. This contains the secrets necessary for authz, so handle carefully.
func GenerateCerts ¶
GenerateCerts generates TLS CA certs and client & server certs to use for agent traffic.
type Client ¶
type Client struct { Logger *zap.SugaredLogger HTTPClient *http.Client // contains filtered or unexported fields }
func NewClient ¶
func NewClient(log *zap.SugaredLogger, certs *Certs, ipAddr string, port int, opts ...ClientOption) (*Client, error)
func (*Client) Dial ¶
Dial establishes a connection to the given address, using the node as a proxy.
func (*Client) DialContext ¶
DialContext establishes a connection to the given address using the given network type, tunneled through a WebSocket connection with the node.
func (*Client) ReadFile ¶
ReadFile reads a file from the remote node, returning io.ErrNotExist if it is not found.
func (*Client) StartHeartbeat ¶
func (n *Client) StartHeartbeat()
func (*Client) StartProc ¶
func (c *Client) StartProc(ctx context.Context, runReq clusteriface.StartProcRequest) (clusteriface.Process, error)
func (*Client) StopHeartbeat ¶
func (n *Client) StopHeartbeat()
type ClientOption ¶
type ClientOption func(c *Client)
func WithClientLogger ¶
func WithClientLogger(l *zap.Logger) ClientOption
func WithClientWaitInterval ¶
func WithClientWaitInterval(d time.Duration) ClientOption
func WithCustomizeRetryableClient ¶
func WithCustomizeRetryableClient(f func(r *retryablehttp.Client)) ClientOption
type ConnectRequest ¶
type FetchRequest ¶
type NodeAgent ¶
type NodeAgent struct {
// contains filtered or unexported fields
}
NodeAgent is an HTTP agent that runs on each node. The agent requires mTLS for both traffic encryption and authz.
func NewNodeAgent ¶
NewNodeAgent constructs a new host agent.
type Option ¶
type Option func(n *NodeAgent)
func WithHeartbeatFailureHandler ¶
func WithHeartbeatFailureHandler(f func()) Option
func WithHeartbeatTimeout ¶
func WithListenAddr ¶
func WithLogLevel ¶
func WithLogger ¶
type PostCommandRequest ¶
Directories ¶
Path | Synopsis |
---|---|
Package process provides a client and server for a remote process runner which streams stdin (client->server) and stdout & stderr (server->client).
|
Package process provides a client and server for a remote process runner which streams stdin (client->server) and stdout & stderr (server->client). |