session

package module
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 3

README

README

This README would normally document whatever steps are necessary to get your application up and running.

What is this repository for?
How do I get set up?
  • Summary of set up
  • Configuration
  • Dependencies
  • Database configuration
  • How to run tests
  • Deployment instructions
Contribution guidelines
  • Writing tests
  • Code review
  • Other guidelines
Who do I talk to?
  • Repo owner or admin
  • Other community or team contact

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceInfoResolver

type DeviceInfoResolver interface {
	GetHardware() string
	GetRuntime() string
	GetOS() string
	GetDeviceModel() string
	GetBrowserType() string
	GetAppVersion() string
	GetOSVersion() string
}

type Session

type Session interface {
	SetCustomerDetails(id string, isNew bool)
	SetOtpData(uuid string)
	SetFakeNow(fakeNow time.Time)
	GetFixedCacheVersions() map[string]string
	SetFixedCacheVersions(versions map[string]string)
	GetCurrentCacheVersions() map[string]string
	SetCurrentCacheVersions(versions map[string]string)
	GetOtpData() string
	GetIsNoCustomer() bool
	GetIsCustomerNew() bool
	GetCustomerId() string
	HasFakeNow() bool
	GetNow() time.Time
	GetId() string
	SetLang(lang string)
	GetLang() string
	SetTermsApproval(termsApproval bool)
	GetTermsApproval() bool
	SetDeviceInfo(hardware, runtime, os, deviceModel, browserType, appVersion, osVersion string)
	GetDeviceInfo() DeviceInfoResolver
	SetReferrer(string)
	GetReferrer() string
}

type SessionRepo

type SessionRepo interface {
	GetUserSessionByTokenToStruct(context context.Context, token string, dest interface{}) (bool, error)
	InsertOrUpdate(ctx context.Context, id string, obj interface{}) error
	GetCacheVersions(ctx context.Context, now time.Time, filterAction string, filterType string) (map[string]string, error)
	GetCollectionsFilterActions(ctx context.Context, filterAction string) ([]string, error)
}

type SessionResolver

type SessionResolver interface {
	SetDataToContext(c context.Context, cSession Session) (context.Context, error)
	GetSessionById(c context.Context, id string) (bool, Session, error)
	GetTokenDataValueAsString(c context.Context, key string) (string, error)
	NewSession(id string) Session
	SaveSession(c context.Context, cSession Session) error
	GetCurrentSession(c context.Context) (Session, error)
	FreezeCacheVersionsForSession(c context.Context, curSession Session, action string, cacheType string) error
	UnFreezeCacheVersionsForSession(c context.Context, curSession Session, action string) error
	IsObsolete(c context.Context, sessionId string) (bool, error)
}

type SessionResolverBuilder

type SessionResolverBuilder interface {
	SetRepo(repo SessionRepo) SessionResolverBuilder
	Build() (SessionResolver, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳