Documentation ¶
Index ¶
- func DeepClone(v interface{}) interface{}
- func DeepCopy(dst, src interface{})
- type Map
- func (m *Map) Del(key interface{})
- func (m *Map) Get(key interface{}) interface{}
- func (m *Map) Len() int
- func (m *Map) LockRange(f func(interface{}, interface{}))
- func (m *Map) RLockRange(f func(interface{}, interface{}))
- func (m *Map) Set(key interface{}, value interface{})
- func (m *Map) TestAndSet(key interface{}, value interface{}) interface{}
- func (m *Map) UnsafeDel(key interface{})
- func (m *Map) UnsafeGet(key interface{}) interface{}
- func (m *Map) UnsafeLen() int
- func (m *Map) UnsafeRange(f func(interface{}, interface{}))
- func (m *Map) UnsafeSet(key interface{}, value interface{})
- type Semaphore
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Map ¶
Example ¶
package main import ( "fmt" "github.com/name5566/leaf/util" ) func main() { m := new(util.Map) fmt.Println(m.Get("key")) m.Set("key", "value") fmt.Println(m.Get("key")) m.Del("key") fmt.Println(m.Get("key")) m.Set(1, "1") m.Set(2, 2) m.Set("3", 3) fmt.Println(m.Len()) }
Output: <nil> value <nil> 3
func (*Map) RLockRange ¶
func (m *Map) RLockRange(f func(interface{}, interface{}))
func (*Map) TestAndSet ¶
func (m *Map) TestAndSet(key interface{}, value interface{}) interface{}
func (*Map) UnsafeRange ¶
func (m *Map) UnsafeRange(f func(interface{}, interface{}))
Click to show internal directories.
Click to hide internal directories.