session

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 3 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	Name string
	Kind string
}

Location represents the location of the sessionId

func NewHeaderLocation

func NewHeaderLocation(name string) *Location

NewHeaderLocation creates a new sessionIdLocation for header

func NewLocation

func NewLocation(name, kind string) *Location

NewLocation creates a new sessionIdLocation

func NewQueryLocation

func NewQueryLocation(name string) *Location

NewQueryLocation creates a new sessionIdLocation for query

type Locator

type Locator struct{}

Locator is a struct that handles the location of session IDs in HTTP requests

func (*Locator) Locate

func (l *Locator) Locate(location *Location, request *http.Request) (string, error)

Locate retrieves the session ID from the specified location in the HTTP request

func (*Locator) Set

func (l *Locator) Set(location *Location, values url.Values, id string) error

Set sets the session ID in the specified location in the HTTP request

type SessionProvider

type SessionProvider struct {
	Locator
	Locations []*Location
}

func (*SessionProvider) SessionId

func (p *SessionProvider) SessionId(request *http.Request) string

SessionId retrieves the session ID from the request by checking all configured locations

Jump to

Keyboard shortcuts

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