wsconncache
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package wsconncache caches workspace agent connections by UUID.Deprecated: Use ServerTailnet instead.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeAgentProvider¶added inv0.26.2
type AgentProvider struct {Cache *Cache}
func (*AgentProvider)AgentConn¶added inv0.26.2
func (a *AgentProvider) AgentConn(_context.Context, agentIDuuid.UUID) (*codersdk.WorkspaceAgentConn, func(),error)
func (*AgentProvider)Close¶added inv0.26.2
func (a *AgentProvider) Close()error
func (*AgentProvider)ReverseProxy¶added inv0.26.2
func (a *AgentProvider) ReverseProxy(targetURL *url.URL, dashboardURL *url.URL, agentIDuuid.UUID) (*httputil.ReverseProxy, func(),error)
typeCache¶
type Cache struct {// contains filtered or unexported fields}
funcNewdeprecated
New creates a new workspace connection cache that closes connections afterthe inactive timeout provided.
Agent connections are cached due to Wireguard negotiation taking a fewhundred milliseconds, depending on latency.
Deprecated: Use coderd.NewServerTailnet instead. wsconncache is being phasedout because it creates a unique Tailnet for each agent.See:https://github.com/coder/coder/issues/8218
func (*Cache)Acquire¶
Acquire gets or establishes a connection with the dialer using the ID provided.If a connection is in-progress, that connection or error will be returned.
The returned function is used to release a lock on the connection. Once zerolocks exist on a connection, the inactive timeout will begin to tick down.After the time expires, the connection will be cleared from the cache.
typeConn¶
type Conn struct {*codersdk.WorkspaceAgentConn// contains filtered or unexported fields}
Conn wraps an agent connection with a reusable HTTP transport.