session

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2021 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
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.

type Info

type Info struct {
	sync.RWMutex
	Id                    string
	SessionTls            *tls.Config
	Status                pbs.SESSIONSTATUS
	LookupSessionResponse *pbs.LookupSessionResponse
	ConnInfoMap           map[string]*ConnInfo
}

Info defines the information about a session

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL