sessionstorage

package
v0.17.0-beta09 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 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 {
	// InsertSession inserts session in session storage and associate it to the
	// given deviceId.
	InsertSession(deviceId uint64, session event.Session)
	// IncSessionPageviewCount increments pageview and returns it.
	IncSessionPageviewCount(deviceId uint64) (event.Session, bool)
	// IdentifySession updates stored session visitor id. Updated session and
	// boolean found flag are returned.
	IdentifySession(deviceId uint64, visitorId string) (event.Session, bool)
	// WaitForSession retrieves stored session and returns it. If session is not
	// found, it waits until it is created or timeout.
	// Returned boolean flag is false if wait timed out and returned an empty
	// session.
	WaitSession(deviceId uint64, timeout time.Duration) (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