Documentation
¶
Index ¶
- Constants
- type Encoder
- type Engine
- type EngineProperties
- type FileEngine
- func (e *FileEngine) Enabled() bool
- func (e *FileEngine) GetSession(id string, ctx context.Context) (Session, error)
- func (e *FileEngine) Name() string
- func (e *FileEngine) NewId() string
- func (e *FileEngine) Purge() error
- func (e *FileEngine) Read(id string, v any) error
- func (e *FileEngine) SessionNotExists(id string) (bool, error)
- func (e *FileEngine) SetEnabled(enabled bool)
- func (e *FileEngine) SetName(n string)
- func (e *FileEngine) Start(_ context.Context) error
- func (e *FileEngine) Stop() error
- func (e *FileEngine) Store(id string, v any) error
- func (e *FileEngine) StoreSession(id string, s Session) error
- type JsonEncoder
- type RedisEngine
- func (e *RedisEngine) Enabled() bool
- func (e *RedisEngine) GetSession(id string, ctx context.Context) (Session, error)
- func (e *RedisEngine) Name() string
- func (e *RedisEngine) NewId() string
- func (e *RedisEngine) Purge() error
- func (e *RedisEngine) Read(id string, v any) error
- func (e *RedisEngine) SessionNotExists(id string) (bool, error)
- func (e *RedisEngine) SetEnabled(enabled bool)
- func (e *RedisEngine) SetName(n string)
- func (e *RedisEngine) Start(ctx context.Context) error
- func (e *RedisEngine) Stop() error
- func (e *RedisEngine) Store(id string, v any) error
- func (e *RedisEngine) StoreSession(id string, s Session) error
- type Session
Constants ¶
View Source
const ( ContextEngValue = "HTTPOKSESSCTXENGVALUE" ContextSessValue = "HTTPOKSESSCTXSESSVALUE" DefaultName = "HTTPOKSESSID" DefaultPrefix = "httpok:session" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface {
Enabled() bool
NewId() string
SetEnabled(bool)
// TODO: PurgeSession(id string)
Name() string
SetName(string)
Read(string, any) error
Start(context.Context) error
Stop() error
Store(string, any) error
Purge() error
GetSession(string, context.Context) (Session, error)
SessionNotExists(string) (bool, error)
StoreSession(string, Session) error
}
type EngineProperties ¶
type FileEngine ¶
type FileEngine struct {
EngineProperties
Dir string
}
func NewFileEngine ¶
func NewFileEngine() *FileEngine
func (*FileEngine) Enabled ¶
func (e *FileEngine) Enabled() bool
func (*FileEngine) GetSession ¶
func (*FileEngine) Name ¶
func (e *FileEngine) Name() string
func (*FileEngine) NewId ¶
func (e *FileEngine) NewId() string
func (*FileEngine) Purge ¶
func (e *FileEngine) Purge() error
func (*FileEngine) SessionNotExists ¶
func (e *FileEngine) SessionNotExists(id string) (bool, error)
func (*FileEngine) SetEnabled ¶
func (e *FileEngine) SetEnabled(enabled bool)
func (*FileEngine) SetName ¶
func (e *FileEngine) SetName(n string)
func (*FileEngine) Stop ¶
func (e *FileEngine) Stop() error
func (*FileEngine) StoreSession ¶
func (e *FileEngine) StoreSession(id string, s Session) error
type JsonEncoder ¶
type JsonEncoder struct {
}
type RedisEngine ¶
type RedisEngine struct {
EngineProperties
// contains filtered or unexported fields
}
func NewRedisEngine ¶
func NewRedisEngine() (*RedisEngine, error)
func (*RedisEngine) Enabled ¶
func (e *RedisEngine) Enabled() bool
func (*RedisEngine) GetSession ¶
func (*RedisEngine) Name ¶
func (e *RedisEngine) Name() string
func (*RedisEngine) NewId ¶
func (e *RedisEngine) NewId() string
func (*RedisEngine) Purge ¶
func (e *RedisEngine) Purge() error
func (*RedisEngine) SessionNotExists ¶
func (e *RedisEngine) SessionNotExists(id string) (bool, error)
func (*RedisEngine) SetEnabled ¶
func (e *RedisEngine) SetEnabled(enabled bool)
func (*RedisEngine) SetName ¶
func (e *RedisEngine) SetName(n string)
func (*RedisEngine) Stop ¶
func (e *RedisEngine) Stop() error
func (*RedisEngine) StoreSession ¶
func (e *RedisEngine) StoreSession(id string, s Session) error
Click to show internal directories.
Click to hide internal directories.