Documentation ¶
Index ¶
- Constants
- Variables
- func ValueTypesConvertNameToType(t string) (uint8, error)
- type Backend
- type RamStorage
- type Session
- type SessionDefault
- type SessionID
- type Value
- func (b *Value) Delete(key string) (ok bool, err error)
- func (b *Value) GetBool(key string) (val bool, exist bool, err error)
- func (b *Value) GetFloat32(key string) (val float32, exist bool, err error)
- func (b *Value) GetFloat64(key string) (val float64, exist bool, err error)
- func (b *Value) GetInt(key string) (val int, exist bool, err error)
- func (b *Value) GetInt64(key string) (val int64, exist bool, err error)
- func (b *Value) GetString(key string) (val string, exist bool, err error)
- func (b *Value) IsKeyExist(key string) bool
- func (b *Value) Iterator(fn func(string, *ValueTypes, error))
- func (v Value) MarshalEasyJSON(w *jwriter.Writer)
- func (v Value) MarshalJSON() ([]byte, error)
- func (b *Value) SetBool(key string, val bool) (err error)
- func (b *Value) SetFloat32(key string, val float32) (err error)
- func (b *Value) SetFloat64(key string, val float64) (err error)
- func (b *Value) SetInt(key string, val int) (err error)
- func (b *Value) SetInt64(key string, val int64) (err error)
- func (b *Value) SetString(key string, val string) (err error)
- func (v *Value) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Value) UnmarshalJSON(data []byte) error
- func (b *Value) UpBool(key string, val bool) (err error)
- func (b *Value) UpFloat32(key string, val float32) (err error)
- func (b *Value) UpFloat64(key string, val float64) (err error)
- func (b *Value) UpInt(key string, val int) (err error)
- func (b *Value) UpInt64(key string, val int64) (err error)
- func (b *Value) UpString(key string, val string) (err error)
- type ValueTypes
Constants ¶
View Source
const ( Int = iota Int64 Float32 Float64 String Bool )
Variables ¶
Functions ¶
Types ¶
type Backend ¶
type Backend interface { SetExpiriesSecond(int64) Get(SessionID) (raw []byte, exist bool, err error) Save(SessionID, []byte) error }
func NewBackendRam ¶
type RamStorage ¶
type RamStorage struct {
// contains filtered or unexported fields
}
func (*RamStorage) SetExpiriesSecond ¶
func (r *RamStorage) SetExpiriesSecond(exp int64)
type Session ¶
type Session interface { Get(tok *token.Token) (*Value, error) Save(tok *token.Token, val *Value) error }
func NewSession ¶
type SessionDefault ¶
type SessionDefault struct {
// contains filtered or unexported fields
}
type Value ¶
type Value struct { S map[string]*ValueTypes `json:"val"` // contains filtered or unexported fields }
func (*Value) GetFloat32 ¶
func (*Value) GetFloat64 ¶
func (*Value) IsKeyExist ¶
func (Value) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Value) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Value) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Value) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ValueTypes ¶
type ValueTypes struct { Type uint8 `json:"t"` Value interface{} `json:"d"` }
func (*ValueTypes) Cast ¶
func (b *ValueTypes) Cast() (*ValueTypes, error)
Click to show internal directories.
Click to hide internal directories.