sessionstorage

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Session storage service configuration options.

func ProvideConfig

func ProvideConfig() Config

ProvideConfig is a wire provider for session storage configuration.

type Service

type Service interface {
	// GetSession retrieves stored session and returns it.
	// Returned boolean flag is false is no session was found.
	GetSession(visitorId string) (event.Session, bool)
	// UpsertSession updates or insert a new session and return true if upsert
	// wasn't ignored. Upsert are ignored if more recent session already exists.
	// A session is considered more recent if stored session UUID differ and
	// session.SessionTime() is more recent or if sessions shares same session
	// UUIDs but session.Version() is greater than stored one.
	UpsertSession(session event.Session) bool
}

Service define an in memory session storage.

func ProvideService

func ProvideService(
	logger zerolog.Logger,
	cfg Config,
	promRegistry *prometheus.Registry,
) Service

ProvideService is a wire provider for in memory session storage.

Jump to

Keyboard shortcuts

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