session

package
v0.0.0-...-b667aad Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 3 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
	SessCtxKey string
}

func (*Manager) GetSession

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

func (*Manager) InitSession

func (m *Manager) InitSession(ctx *context.Context, id string) (Session, error)

func (*Manager) RefreshSession

func (m *Manager) RefreshSession(ctx *context.Context) (Session, error)

func (*Manager) RemoveSession

func (m *Manager) RemoveSession(ctx *context.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) (string, error)
	Set(ctx context.Context, key string, val string) 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