backup

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupCtx

func BackupCtx(ctx context.Context)

Set current Sessioin

func ClearCtx

func ClearCtx()

Unset current Session

func Init

func Init(opts Options)

Init gloabal session manager It uses env config first, the key is localsession.SESSION_CONFIG_KEY

func RecoverCtxOnDemands

func RecoverCtxOnDemands(ctx context.Context, handler BackupHandler) context.Context

If handler != nil, this func will try to merge metainfo and pre-defined key-values (through Options.BackupHanlder) from backup context into given context

Types

type BackupHandler

type BackupHandler func(prev, cur context.Context) (ctx context.Context, backup bool)

BackupHandler is used to decide and recover prev context to cur context

type Options

type Options struct {
	Enable bool
	localsession.ManagerOptions
}

Options

func DefaultOptions

func DefaultOptions() Options

Default Options

Jump to

Keyboard shortcuts

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