Documentation ¶
Index ¶
- type Manager
- type MemoryProvider
- type Provider
- type Session
- func (sess *Session) DeleteAndNewSession() (err error)
- func (sess *Session) DeleteSession() (err error)
- func (sess *Session) Get(key string) (value interface{}, ok bool)
- func (sess *Session) GetBool(key string) bool
- func (sess *Session) GetIntOrZero(key string) (i int)
- func (sess *Session) GetWithType(key string, out interface{}) (err error)
- func (sess *Session) SaveAndReload() (err error)
- func (sess *Session) Set(key string, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryProvider ¶
type MemoryProvider struct {
// contains filtered or unexported fields
}
func NewMemoryProvider ¶
func NewMemoryProvider() *MemoryProvider
func (*MemoryProvider) Delete ¶
func (provider *MemoryProvider) Delete(Id string) (err error)
type Provider ¶
type Provider interface { //caller should not modify Value Get(Id string) (Value []byte, Exist bool, err error) //caller should not modify Value Set(Id string, Value []byte) (err error) //when id not found,it should not report err ,just return silently Delete(Id string) (err error) }
all call should thread safe not any transaction about single session
type Session ¶
type Session struct { Id string // contains filtered or unexported fields }
any call in this object not thread safe
func (*Session) DeleteAndNewSession ¶
delete current session,delete all data in this session ,create a new one, it will panic if an error happened
func (*Session) DeleteSession ¶
delete current session,and delete all data in this session
func (*Session) GetIntOrZero ¶
func (*Session) GetWithType ¶
func (*Session) SaveAndReload ¶
save this Session and reload it from SessionProvider,should only used for test
Source Files ¶
Click to show internal directories.
Click to hide internal directories.