Documentation ¶
Overview ¶
Package session provides functions for sessions of incoming requests.
Index ¶
- func ContextWithID(ctx context.Context, id ID) context.Context
- func ContextWithInbound(ctx context.Context, inbound *Inbound) context.Context
- func ContextWithOutbound(ctx context.Context, outbound *Outbound) context.Context
- func ExportIDToError(ctx context.Context) errors.ExportOption
- type ID
- type Inbound
- type Outbound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithID ¶
ContextWithID returns a new context with the given ID.
func ContextWithInbound ¶
func ContextWithOutbound ¶
func ExportIDToError ¶
func ExportIDToError(ctx context.Context) errors.ExportOption
ExportIDToError transfers session.ID into an error object, for logging purpose. This can be used with error.WriteToLog().
Types ¶
type ID ¶
type ID uint32
ID of a session.
func IDFromContext ¶
IDFromContext returns ID in this context, or 0 if not contained.
type Inbound ¶
type Inbound struct { // Source address of the inbound connection. Source net.Destination // Getaway address Gateway net.Destination // Tag of the inbound proxy that handles the connection. Tag string // User is the user that authencates for the inbound. May be nil if the protocol allows anounymous traffic. User *protocol.MemoryUser }
Inbound is the metadata of an inbound connection.
func InboundFromContext ¶
type Outbound ¶
type Outbound struct { // Target address of the outbound connection. Target net.Destination // Gateway address Gateway net.Address // ResolvedIPs is the resolved IP addresses, if the Targe is a domain address. ResolvedIPs []net.IP }
Outbound is the metadata of an outbound connection.
func OutboundFromContext ¶
Click to show internal directories.
Click to hide internal directories.