Versions in this module Expand all Collapse all v0 v0.1.0 May 17, 2022 Changes in this version + const PackageVersion + const TunnelConstraintsClusterIDMaxLength + const TunnelConstraintsClusterIDMinLength + const TunnelConstraintsTunnelIDChars + const TunnelConstraintsTunnelIDLength + const TunnelConstraintsTunnelNameMaxLength + const TunnelConstraintsTunnelNameMinLength + var DevServiceProperties = TunnelServiceProperties + var ErrMultipleHosts = errors.New("there are multiple hosts for the tunnel, specify the host ID to connect to") + var ErrNoConnections = errors.New("the specified host is not currently accepting connections to the tunnel") + var ErrNoRelayConnections = errors.New("the host is not currently accepting tunnel relay connections") + var ErrNoTunnel = errors.New("tunnel cannot be nil") + var ErrNoTunnelEndpoints = errors.New("tunnel endpoints cannot be nil or empty") + var ErrPortNotForwarded = errors.New("the port is not forwarded") + var ErrSSHConnectionClosed = errors.New("the ssh connection is closed") + var PortURIToken = "{port}" + var PpeServiceProperties = TunnelServiceProperties + var ServiceProperties = TunnelServiceProperties + var TunnelConstraintsClusterIDRegex = regexp.MustCompile(...) + var TunnelConstraintsTunnelIDRegex = regexp.MustCompile(...) + var TunnelConstraintsTunnelNameRegex = regexp.MustCompile(...) + var TunnelConstraintsTunnelTagRegex = regexp.MustCompile(`^[\w-=]+$`) + type Client struct + func NewClient(logger *log.Logger, tunnel *Tunnel, ...) (*Client, error) + func (c *Client) Close() error + func (c *Client) Connect(ctx context.Context, hostID string) error + func (c *Client) ConnectToForwardedPort(ctx context.Context, listenerIn *net.Listener, port uint16) (io.ReadWriteCloser, chan error) + func (c *Client) WaitForForwardedPort(ctx context.Context, port uint16) error + type LiveShareRelayTunnelEndpoint struct + RelayClientSasToken string + RelayHostSasToken string + RelayURI string + WorkspaceID string + type LocalNetworkTunnelEndpoint struct + HostEndpoints []string + type Manager struct + func NewManager(userAgents []UserAgent, tp tokenProviderfn, tunnelServiceUrl *url.URL, ...) (*Manager, error) + func (m *Manager) CreateTunnel(ctx context.Context, tunnel *Tunnel, options *TunnelRequestOptions) (t *Tunnel, err error) + func (m *Manager) CreateTunnelPort(ctx context.Context, tunnel *Tunnel, port *TunnelPort, ...) (tp *TunnelPort, err error) + func (m *Manager) DeleteTunnel(ctx context.Context, tunnel *Tunnel, options *TunnelRequestOptions) error + func (m *Manager) DeleteTunnelEndpoints(ctx context.Context, tunnel *Tunnel, hostID string, ...) error + func (m *Manager) DeleteTunnelPort(ctx context.Context, tunnel *Tunnel, port uint16, ...) error + func (m *Manager) GetTunnel(ctx context.Context, tunnel *Tunnel, options *TunnelRequestOptions) (t *Tunnel, err error) + func (m *Manager) GetTunnelPort(ctx context.Context, tunnel *Tunnel, port int, options *TunnelRequestOptions) (tp *TunnelPort, err error) + func (m *Manager) ListTunnelPorts(ctx context.Context, tunnel *Tunnel, options *TunnelRequestOptions) (tp []*TunnelPort, err error) + func (m *Manager) ListTunnels(ctx context.Context, clusterID string, domain string, ...) (ts []*Tunnel, err error) + func (m *Manager) SearchTunnels(ctx context.Context, tags []string, requireAllTags bool, clusterID string, ...) (ts []*Tunnel, err error) + func (m *Manager) UpdateTunnel(ctx context.Context, tunnel *Tunnel, updateFields []string, ...) (t *Tunnel, err error) + func (m *Manager) UpdateTunnelEndpoint(ctx context.Context, tunnel *Tunnel, endpoint *TunnelEndpoint, ...) (te *TunnelEndpoint, err error) + func (m *Manager) UpdateTunnelPort(ctx context.Context, tunnel *Tunnel, port *TunnelPort, updateFields []string, ...) (tp *TunnelPort, err error) + type ProblemDetails struct + Detail string + Errors map[string][]string + Title string + type RateStatus struct + PeriodSeconds uint32 + ResetSeconds uint32 + type ResourceStatus struct + Current uint64 + Limit uint64 + type ServiceVersionDetails struct + AzureLocation string + ClusterID string + CommitDate string + CommitID string + Version string + type Tunnel struct + AccessControl *TunnelAccessControl + AccessTokens map[TunnelAccessScope]string + ClusterID string + Created *time.Time + Description string + Domain string + Endpoints []TunnelEndpoint + Name string + Options *TunnelOptions + Ports []TunnelPort + Status *TunnelStatus + Tags []string + TunnelID string + func (t *Tunnel) Table() table.Table + type TunnelAccessControl struct + Entries []TunnelAccessControlEntry + type TunnelAccessControlEntry struct + IsDeny bool + IsInherited bool + IsInverse bool + Organization string + Provider string + Scopes []string + Subjects []string + Type TunnelAccessControlEntryType + type TunnelAccessControlEntryProvider string + const TunnelAccessControlEntryProviderGitHub + const TunnelAccessControlEntryProviderIPv4 + const TunnelAccessControlEntryProviderIPv6 + const TunnelAccessControlEntryProviderMicrosoft + const TunnelAccessControlEntryProviderSsh + type TunnelAccessControlEntryProviders []TunnelAccessControlEntryProvider + type TunnelAccessControlEntryType string + const TunnelAccessControlEntryTypeAnonymous + const TunnelAccessControlEntryTypeGroups + const TunnelAccessControlEntryTypeIPAddressRanges + const TunnelAccessControlEntryTypeNone + const TunnelAccessControlEntryTypeOrganizations + const TunnelAccessControlEntryTypePublicKeys + const TunnelAccessControlEntryTypeRepositories + const TunnelAccessControlEntryTypeUsers + type TunnelAccessScope string + const TunnelAccessScopeConnect + const TunnelAccessScopeCreate + const TunnelAccessScopeHost + const TunnelAccessScopeInspect + const TunnelAccessScopeManage + type TunnelAccessScopes []TunnelAccessScope + type TunnelAccessSubject struct + ID string + Matches []TunnelAccessSubject + Name string + OrganizationID string + Type TunnelAccessControlEntryType + type TunnelAuthenticationScheme string + const TunnelAuthenticationSchemeAad + const TunnelAuthenticationSchemeGitHub + const TunnelAuthenticationSchemeTunnel + type TunnelAuthenticationSchemes []TunnelAuthenticationScheme + type TunnelConnectionMode string + const TunnelConnectionModeLiveShareRelay + const TunnelConnectionModeLocalNetwork + const TunnelConnectionModeTunnelRelay + type TunnelEndpoint struct + ConnectionMode TunnelConnectionMode + HostID string + HostPublicKeys []string + PortURIFormat string + type TunnelHeaderName string + const TunnelHeaderNameXGithubSshKey + const TunnelHeaderNameXRequestID + const TunnelHeaderNameXTunnelAuthorization + type TunnelHeaderNames []TunnelHeaderName + type TunnelOptions struct + IsGloballyAvailable bool + type TunnelPort struct + AccessControl *TunnelAccessControl + AccessTokens map[TunnelAccessScope]string + ClusterID string + Options *TunnelOptions + PortNumber uint16 + Protocol string + Status *TunnelPortStatus + TunnelID string + func NewTunnelPort(portNumber uint16, clusterId string, tunnelId string, protocol TunnelProtocol) *TunnelPort + func (tp *TunnelPort) Table() table.Table + type TunnelPortStatus struct + ClientConnectionCount *ResourceStatus + ClientConnectionRate *RateStatus + HttpRequestRate *RateStatus + LastClientConnectionTime *time.Time + type TunnelProtocol string + const TunnelProtocolAuto + const TunnelProtocolHttp + const TunnelProtocolHttps + const TunnelProtocolRdp + const TunnelProtocolSsh + const TunnelProtocolTcp + const TunnelProtocolUdp + type TunnelRelayTunnelEndpoint struct + ClientRelayURI string + HostRelayURI string + type TunnelRequestOptions struct + AccessToken string + AdditionalHeaders map[string]string + FollowRedirects bool + ForceRename bool + IncludePorts bool + Scopes TunnelAccessScopes + TokenScopes TunnelAccessScopes + type TunnelServiceProperties struct + GitHubAppClientID string + ServiceAppID string + ServiceInternalAppID string + ServiceURI string + type TunnelStatus struct + ApiReadRate *RateStatus + ApiUpdateRate *RateStatus + ClientConnectionCount *ResourceStatus + ClientConnectionRate *RateStatus + DataTransferRate *RateStatus + HostConnectionCount *ResourceStatus + LastClientConnectionTime *time.Time + LastHostConnectionTime *time.Time + PortCount *ResourceStatus + type UserAgent struct + Name string + Version string