Documentation ¶
Index ¶
- func GC() error
- func Get(ctx context.Context, id string) (interface{}, error)
- func GetCache(ctx context.Context, id string) ([]byte, error)
- func InitSession(cfg config.SessionConfig) error
- func New(ctx context.Context, id string) (string, error)
- func PutCache(ctx context.Context, id string, data []byte) error
- func Register(name string, driver Driver) error
- func Release(ctx context.Context, id string) error
- type Driver
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSession ¶
func InitSession(cfg config.SessionConfig) error
InitSession inits the session defined in the config file
Types ¶
type Driver ¶
type Driver interface { // Init setups a driver Init(paras map[string]interface{}) error // New creates a new session and gets the id string New(ctx context.Context, id string) (string, error) // Get returns a session by its id Get(ctx context.Context, id string) (interface{}, error) // Release frees the resource of a session by its id and removes the id Release(ctx context.Context, id string) error // Should merge to 'Get' and add 'name' paras // GetCache gets the session data by its id GetCache(ctx context.Context, id string) ([]byte, error) // PutCache puts the session data by its id PutCache(ctx context.Context, id string, data []byte) error // GC starts to garbage collection GC() error }
Driver provides the session interfaces
Click to show internal directories.
Click to hide internal directories.