session

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Store
	Propagator
	CtxSessionKey string
}

func (*Manager) GetSession

func (m *Manager) GetSession(ctx *mirror.Context) (Session, error)

func (*Manager) InitSession

func (m *Manager) InitSession(ctx *mirror.Context) (Session, error)

func (*Manager) RefreshSession

func (m *Manager) RefreshSession(ctx *mirror.Context) error

func (*Manager) RemoveSession

func (m *Manager) RemoveSession(ctx *mirror.Context) error

type Propagator

type Propagator interface {
	Inject(id string, writer http.ResponseWriter) error
	Extract(req *http.Request) (string, error)
	Remove(writer http.ResponseWriter) error
}

type Session

type Session interface {
	Get(ctx context.Context, key string) (any, error)
	Set(ctx context.Context, key string, value any) error
	ID() string
}

type Store

type Store interface {
	Generate(ctx context.Context, id string) (Session, error)
	Refresh(ctx context.Context, id string) error
	Remove(ctx context.Context, id string) error
	Get(ctx context.Context, id string) (Session, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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