Documentation ¶
Index ¶
- func AddInt(vs Updater, key string, step int) int
- func AddInt64(vs Updater, key string, step int64) int64
- func AddUint(vs Updater, key string, step uint) uint
- func AddUint64(vs Updater, key string, step uint64) uint64
- func Append(dst Setter, src Ranger)
- func Get(vs Getter, key string) reflectx.Value
- func Getsert(vs Updater, key string, constructor func() interface{}) interface{}
- func Plus(vs Updater, key string, step interface{}) (result reflectx.Value)
- type Form
- func (m Form) AddString(key, value string)
- func (m Form) AddValues(key string, values ...interface{})
- func (m *Form) Decode(b []byte) error
- func (m Form) Encode() ([]byte, error)
- func (m Form) Get(key string) interface{}
- func (m Form) Len() int
- func (m Form) Range(f func(key string, value interface{}) bool)
- func (m Form) Remove(key string)
- func (m *Form) RemoveAll()
- func (m Form) Set(key string, value interface{})
- func (m Form) SetValues(key string, values ...interface{})
- func (m Form) Update(key string, fn func(interface{}) interface{}) interface{}
- func (m Form) ValueOf(key string) reflectx.Value
- type Getter
- type JsonMap
- func (m *JsonMap) Decode(b []byte) error
- func (m JsonMap) Encode() ([]byte, error)
- func (m JsonMap) Get(key string) interface{}
- func (m JsonMap) Len() int
- func (m JsonMap) Range(f func(key string, value interface{}) bool)
- func (m JsonMap) Remove(key string)
- func (m *JsonMap) RemoveAll()
- func (m JsonMap) Set(key string, value interface{})
- func (m JsonMap) Update(key string, fn func(interface{}) interface{}) interface{}
- func (m JsonMap) ValueOf(key string) reflectx.Value
- type Ranger
- type SafeMap
- func (m *SafeMap) Decode(b []byte) error
- func (m *SafeMap) Encode() ([]byte, error)
- func (m *SafeMap) Get(key string) interface{}
- func (m *SafeMap) Len() int
- func (m *SafeMap) LockGuard(f func(data map[string]interface{}))
- func (m *SafeMap) Range(f func(key string, value interface{}) bool)
- func (m *SafeMap) Remove(key string)
- func (m *SafeMap) RemoveAll()
- func (m *SafeMap) Set(key string, value interface{})
- func (m *SafeMap) Update(key string, fn func(interface{}) interface{}) interface{}
- func (m *SafeMap) ValueOf(key string) reflectx.Value
- type Setter
- type Updater
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddInt ¶
AddInt adds step to key, returns the result as int. If the value of key is not exist or other error, value is set to step.
func AddInt64 ¶
AddInt64 adds step to key, returns the result as int64. If the value of key is not exist or other error, value is set to step.
func AddUint ¶
AddUint adds step to key, returns the result as uint. If the value of key is not exist or other error, value is set to step.
func AddUint64 ¶
AddUint64 adds step to key, returns the result as uint64. If the value of key is not exist or other error, value is set to step.
func Get ¶
GetValue gets the value associated with the given key. If there are no values associated with the key, GetValue returns a nil value.
Types ¶
type Form ¶
func (Form) AddString ¶
Add adds the value to key. It appends to any existing values associated with key.
func (*Form) Decode ¶
Decode parses the URL-encoded query string and returns a map listing the values specified for each key.
func (Form) Encode ¶
Encode encodes the values into URL-encoded form ("bar=baz&foo=quux") sorted by key.
func (Form) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
type Getter ¶
type Getter interface { // Get value from values, it returns nil in case of non-existed. Get(key string) interface{} }
type JsonMap ¶
type JsonMap map[string]interface{}
func (JsonMap) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
type SafeMap ¶
type SafeMap struct {
// contains filtered or unexported fields
}
func NewSafeMap ¶
func (*SafeMap) Range ¶
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
type Setter ¶
type Setter interface { // Set sets the key to value. It replaces any existing values. Set(key string, value interface{}) }
type Updater ¶
type Updater interface { // Get the value of key, use it as input parameter to call fn. // If the return value of fn is not nil, save it with key.6 // Update returns the value of key in the end. Update(key string, fn func(interface{}) interface{}) interface{} }
type Values ¶
type Values interface { Getter Setter Updater Ranger // ValueOf gets the reflectx.Value associated with the given key. // If there are no values associated with the key, ValueOf should return // a nil Value. ValueOf(key string) reflectx.Value Encode() ([]byte, error) Decode([]byte) error // Removes the values associated with key. Remove(key string) RemoveAll() Len() int }