Documentation ¶
Index ¶
- Constants
- func Activate(ctx context.Context, sessClient pbs.SessionServiceClient, ...) (pbs.SESSIONSTATUS, error)
- func Cancel(ctx context.Context, sessClient pbs.SessionServiceClient, sessionId string) (pbs.SESSIONSTATUS, error)
- func CloseConnections(ctx context.Context, sessClient pbs.SessionServiceClient, ...)
- func ConnectConnection(ctx context.Context, sessClient pbs.SessionServiceClient, ...) (pbs.CONNECTIONSTATUS, error)
- type ConnInfo
- type Info
Constants ¶
const ValidateSessionTimeout = 90 * time.Second
ValidateSessionTimeout is the duration of the timeout when the worker queries the controller for the sessionId for which the connection is being requested.
Variables ¶
This section is empty.
Functions ¶
func Activate ¶
func Activate(ctx context.Context, sessClient pbs.SessionServiceClient, workerId, sessionId, tofuToken string, version uint32) (pbs.SESSIONSTATUS, error)
Activate is a helper worker function that sends session activation request to the controller.
func Cancel ¶
func Cancel(ctx context.Context, sessClient pbs.SessionServiceClient, sessionId string) (pbs.SESSIONSTATUS, error)
Cancel is a helper worker function that sends session cancellation request to the controller.
func CloseConnections ¶
func CloseConnections(ctx context.Context, sessClient pbs.SessionServiceClient, sessionInfo *sync.Map, closeInfo map[string]string)
CloseConnections is a helper worker function that sends connection close requests to the controller, and sets close times within the worker. It is called during the worker status loop and on connection exit on the proxy.
closeInfo is a map of connections mapped to their individual session.
func ConnectConnection ¶
func ConnectConnection(ctx context.Context, sessClient pbs.SessionServiceClient, req *pbs.ConnectConnectionRequest) (pbs.CONNECTIONSTATUS, error)
ConnectConnection is a helper worker function that sends connection connect request to the controller. It is called by the worker handler after a connection has been authorized.
Types ¶
type ConnInfo ¶
type ConnInfo struct { Id string ConnCtx context.Context ConnCancel context.CancelFunc Status pbs.CONNECTIONSTATUS CloseTime time.Time }
ConnInfo defines the information about a connection attached to a session
func AuthorizeConnection ¶
func AuthorizeConnection(ctx context.Context, sessClient pbs.SessionServiceClient, workerId, sessionId string) (*ConnInfo, int32, error)
AuthorizeConnection is a helper worker function that sends connection authorization request to the controller. It is called by the worker handler after a connection has been received by the worker, and the session has been validated.