Documentation ¶
Index ¶
- type Client
- func (c *Client) ClusterDetails(ctx context.Context) (*transportv1pb.ClusterDetails, error)
- func (c *Client) DialCluster(ctx context.Context, cluster string, src net.Addr) (net.Conn, error)
- func (c *Client) DialHost(ctx context.Context, hostport, cluster string, src net.Addr, ...) (net.Conn, *transportv1pb.ClusterDetails, error)
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 is a wrapper around a transportv1.TransportServiceClient that hides the implementation details of establishing connections over gRPC streams.
func NewClient ¶
func NewClient(client transportv1pb.TransportServiceClient) (*Client, error)
NewClient constructs a Client that operates on the provided transportv1pb.TransportServiceClient. An error is returned if the client provided is nil.
func (*Client) ClusterDetails ¶
func (c *Client) ClusterDetails(ctx context.Context) (*transportv1pb.ClusterDetails, error)
ClusterDetails retrieves the cluster details as observed by the Teleport Proxy that the Client is connected to.
func (*Client) DialCluster ¶
DialCluster establishes a connection to the provided cluster. The provided src address will be used as the LocalAddr of the returned net.Conn.
func (*Client) DialHost ¶
func (c *Client) DialHost(ctx context.Context, hostport, cluster string, src net.Addr, keyring agent.ExtendedAgent) (net.Conn, *transportv1pb.ClusterDetails, error)
DialHost establishes a connection to the instance in the provided cluster that matches the hostport. If a keyring is provided then it will be forwarded to the remote instance. The src address will be used as the LocalAddr of the returned net.Conn.