Documentation
¶
Index ¶
- Constants
- func CheckDerpConnection(ctx context.Context, baseUrl *url.URL) error
- func GetClientHostname(userName string) (string, error)
- func GetEnvOrDefault(envVar, defaultVal string) string
- func GetURL(host string, port int) string
- func GetWorkspaceHostname(name, namespace string) string
- func ParseWorkspaceHostname(hostname string) (name string, project string, err error)
- func RemoveProtocol(hostPath string) string
- func WaitForSSHClient(ctx context.Context, lc *tsClient.LocalClient, host string, port int, ...) (*ssh.Client, error)
- func WaitHostReachable(ctx context.Context, lc *tailscale.LocalClient, addr Addr, log log.Logger) error
- func WatchNetmap(ctx context.Context, lc *tailscale.LocalClient, ...) error
- type Addr
- type ConnTrackingFunc
- type WorkspaceServer
- type WorkspaceServerConfig
Constants ¶
View Source
const LoftTSNetDomain = "ts.loft"
View Source
const ( // TSPortForwardPort is the fixed port on which the workspace WebSocket reverse proxy listens. TSPortForwardPort string = "12051" )
Variables ¶
This section is empty.
Functions ¶
func CheckDerpConnection ¶
CheckDerpConnection validates the DERP connection
func GetClientHostname ¶
func GetEnvOrDefault ¶
Utility function to get environment variable or default
func GetWorkspaceHostname ¶
func ParseWorkspaceHostname ¶
func RemoveProtocol ¶
RemoveProtocol removes protocol from URL
func WaitForSSHClient ¶
func WaitHostReachable ¶
func WaitHostReachable(ctx context.Context, lc *tailscale.LocalClient, addr Addr, log log.Logger) error
WaitHostReachable polls until the given host is reachable via ts.
func WatchNetmap ¶
func WatchNetmap(ctx context.Context, lc *tailscale.LocalClient, netmapChangedFn func(nm *netmap.NetworkMap)) error
Types ¶
type ConnTrackingFunc ¶
type ConnTrackingFunc func(address string)
type WorkspaceServer ¶
type WorkspaceServer struct {
// contains filtered or unexported fields
}
WorkspaceServer holds the TSNet server and its listeners.
func NewWorkspaceServer ¶
func NewWorkspaceServer(config *WorkspaceServerConfig, logger log.Logger) *WorkspaceServer
NewWorkspaceServer creates a new TSNet server instance.
func (*WorkspaceServer) Start ¶
func (s *WorkspaceServer) Start(ctx context.Context) error
Start initializes the TSNet server, sets up listeners for SSH and HTTP reverse proxy traffic, and waits until the given context is canceled.
func (*WorkspaceServer) Stop ¶
func (s *WorkspaceServer) Stop()
Stop shuts down all listeners and the TSNet server.
Click to show internal directories.
Click to hide internal directories.