session

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 6 Imported by: 0

README

session

chefgo session module.

Documentation

Index

Constants

View Source
const (
	NAME = "SESSION"
)

Variables

This section is empty.

Functions

func Clear

func Clear() error

func Configure

func Configure(cfg Map)

Configure 更新配置

func Delete

func Delete(id string) error

func Go

func Go()

Go 直接开跑 此方法只单独使用模块时用

func Read

func Read(id string) (Map, error)

func Ready

func Ready()

Ready 准备运行 此方法只单独使用模块时用

func Register

func Register(name string, value Any, overrides ...bool)

Register 开放给外

func Write

func Write(id string, value Map, expiries ...time.Duration) error

Types

type Config

type Config struct {
	Driver  string
	Weight  int
	Prefix  string
	Expiry  time.Duration
	Setting Map
}

type Configs

type Configs map[string]Config

type Connect

type Connect interface {
	Open() error
	Close() error

	Read(id string) (Map, error)
	Write(id string, value Map, expiry time.Duration) error
	Delete(id string) error
	Clear(perfix string) error
}

Connect 会话连接

type Driver

type Driver interface {
	Connect(name string, config Config) (Connect, error)
}

Driver 数据驱动

type Instance

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

type Module

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

func (*Module) Clear

func (this *Module) Clear() error

func (*Module) Config

func (this *Module) Config(name string, config Config, override bool)

func (*Module) Configs

func (this *Module) Configs(config Configs, override bool)

func (*Module) Configure

func (this *Module) Configure(global Map)

func (*Module) Connect

func (this *Module) Connect()

func (*Module) Delete

func (this *Module) Delete(id string) error

func (*Module) Driver

func (module *Module) Driver(name string, driver Driver, override bool)

Driver 注册驱动

func (*Module) Initialize

func (this *Module) Initialize()

func (*Module) Launch

func (this *Module) Launch()

func (*Module) Read

func (this *Module) Read(id string) (Map, error)

func (*Module) Register

func (this *Module) Register(name string, value Any, override bool)

func (*Module) Terminate

func (this *Module) Terminate()

func (*Module) Write

func (this *Module) Write(id string, value Map, expiries ...time.Duration) error

Jump to

Keyboard shortcuts

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