sessions

package
v0.0.0-...-9bbed00 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(session *Session) ([]byte, error)

Types

type Session

type Session struct {
	ID string
	// contains filtered or unexported fields
}

func Decode

func Decode(sessionID string, b []byte) (*Session, error)

func (*Session) Clear

func (s *Session) Clear(v proto.Message)

func (*Session) Get

func (s *Session) Get(dest proto.Message) bool

func (*Session) Set

func (s *Session) Set(msg proto.Message)

type SessionComponent

type SessionComponent struct {
	// contains filtered or unexported fields
}

SessionComponent is the component that implements Sessions

func NewSessionComponent

func NewSessionComponent(storage Storage) *SessionComponent

func (*SessionComponent) AddToScope

func (c *SessionComponent) AddToScope(ctx context.Context, scope *scopes.Scope)

func (*SessionComponent) ProcessRequest

func (*SessionComponent) RegisterHandlers

func (c *SessionComponent) RegisterHandlers(s *components.Server, mux *http.ServeMux) error

type Storage

type Storage interface {
	LookupSession(ctx context.Context, sessionID string) (*Session, error)
	WriteSession(ctx context.Context, session *Session) error
}

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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