session

package
v3.46.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package session provides functions for sessions of incoming requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithID

func ContextWithID(ctx context.Context, id ID) context.Context

ContextWithID returns a new context with the given ID.

func ContextWithInbound added in v3.45.1

func ContextWithInbound(ctx context.Context, inbound *Inbound) context.Context

func ContextWithOutbound added in v3.45.1

func ContextWithOutbound(ctx context.Context, outbound *Outbound) context.Context

func ExportIDToError added in v3.27.1

func ExportIDToError(ctx context.Context) errors.ExportOption

Types

type ID

type ID uint32

ID of a session.

func IDFromContext

func IDFromContext(ctx context.Context) ID

IDFromContext returns ID in this context, or 0 if not contained.

func NewID

func NewID() ID

NewID generates a new ID. The generated ID is high likely to be unique, but not cryptographically secure. The generated ID will never be 0.

type Inbound added in v3.45.1

type Inbound struct {
	Source  net.Destination
	Gateway net.Destination
	Tag     string
}

func InboundFromContext added in v3.45.1

func InboundFromContext(ctx context.Context) *Inbound

type Outbound added in v3.45.1

type Outbound struct {
	Target      net.Destination
	Gateway     net.Address
	ResolvedIPs []net.IP
}

func OutboundFromContext added in v3.45.1

func OutboundFromContext(ctx context.Context) *Outbound

Jump to

Keyboard shortcuts

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