Documentation
¶
Index ¶
- type AtomicBool
- type AtomicDuration
- func (d *AtomicDuration) Add(duration time.Duration) time.Duration
- func (d *AtomicDuration) CompareAndSwap(oldval, newval time.Duration) (swapped bool)
- func (d *AtomicDuration) Get() time.Duration
- func (d *AtomicDuration) LoadInt64() int64
- func (d *AtomicDuration) Set(duration time.Duration)
- func (d AtomicDuration) String() string
- type AtomicInt32
- type AtomicInt64
- type AtomicString
- type AtomicUint32
- type AtomicUint64
- type Int64Map
- func (m *Int64Map) Add(key interface{}, delta int64) int64
- func (m *Int64Map) Del(key interface{})
- func (m *Int64Map) For(f func(k interface{}, v int64) bool)
- func (m *Int64Map) Get(key interface{}) (int64, bool)
- func (m *Int64Map) KeyVals() ([]interface{}, []int64)
- func (m *Int64Map) Keys() []interface{}
- func (m *Int64Map) Len() int
- func (m *Int64Map) Set(key interface{}, val int64)
- func (m *Int64Map) Vals() []int64
- type Map
- func (m *Map) Del(key interface{})
- func (m *Map) For(f func(k interface{}, v interface{}) bool)
- func (m *Map) Get(key interface{}) (interface{}, bool)
- func (m *Map) GetTo(key interface{}, ptr interface{}) bool
- func (m *Map) KeyVals() ([]interface{}, []interface{})
- func (m *Map) Keys() []interface{}
- func (m *Map) Len() int
- func (m *Map) Set(key interface{}, val interface{})
- func (m *Map) Vals() []interface{}
- type Semaphore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicBool ¶
type AtomicBool int32
func (*AtomicBool) Get ¶
func (b *AtomicBool) Get() bool
func (*AtomicBool) Set ¶
func (b *AtomicBool) Set(val bool)
type AtomicDuration ¶
type AtomicDuration int64
func (*AtomicDuration) CompareAndSwap ¶
func (d *AtomicDuration) CompareAndSwap(oldval, newval time.Duration) (swapped bool)
func (*AtomicDuration) Get ¶
func (d *AtomicDuration) Get() time.Duration
func (*AtomicDuration) LoadInt64 ¶
func (d *AtomicDuration) LoadInt64() int64
func (*AtomicDuration) Set ¶
func (d *AtomicDuration) Set(duration time.Duration)
func (AtomicDuration) String ¶
func (d AtomicDuration) String() string
type AtomicInt32 ¶
type AtomicInt32 int32
func (*AtomicInt32) Add ¶
func (i *AtomicInt32) Add(n int32) int32
func (*AtomicInt32) CompareAndSwap ¶
func (i *AtomicInt32) CompareAndSwap(oldval, newval int32) (swapped bool)
func (*AtomicInt32) Get ¶
func (i *AtomicInt32) Get() int32
func (*AtomicInt32) Set ¶
func (i *AtomicInt32) Set(n int32)
type AtomicInt64 ¶
type AtomicInt64 int64
func (*AtomicInt64) Add ¶
func (i *AtomicInt64) Add(n int64) int64
func (*AtomicInt64) CompareAndSwap ¶
func (i *AtomicInt64) CompareAndSwap(oldval, newval int64) (swapped bool)
func (*AtomicInt64) Get ¶
func (i *AtomicInt64) Get() int64
func (*AtomicInt64) Set ¶
func (i *AtomicInt64) Set(n int64)
type AtomicString ¶
type AtomicString struct {
// contains filtered or unexported fields
}
AtomicString gives you atomic-style APIs for string, but it's only a convenience wrapper that uses a mutex. So, it's not as efficient as the rest of the atomic types.
func (*AtomicString) CompareAndSwap ¶
func (s *AtomicString) CompareAndSwap(oldval, newval string) (swqpped bool)
func (*AtomicString) Get ¶
func (s *AtomicString) Get() string
func (*AtomicString) Set ¶
func (s *AtomicString) Set(str string)
type AtomicUint32 ¶
type AtomicUint32 uint32
func (*AtomicUint32) Add ¶
func (i *AtomicUint32) Add(n uint32) uint32
func (*AtomicUint32) CompareAndSwap ¶
func (i *AtomicUint32) CompareAndSwap(oldval, newval uint32) (swapped bool)
func (*AtomicUint32) Get ¶
func (i *AtomicUint32) Get() uint32
func (*AtomicUint32) Set ¶
func (i *AtomicUint32) Set(n uint32)
type AtomicUint64 ¶
type AtomicUint64 uint64
func (*AtomicUint64) Add ¶
func (i *AtomicUint64) Add(n uint64) uint64
func (*AtomicUint64) CompareAndSwap ¶
func (i *AtomicUint64) CompareAndSwap(oldval, newval uint64) (swapped bool)
func (*AtomicUint64) Get ¶
func (i *AtomicUint64) Get() uint64
func (*AtomicUint64) Set ¶
func (i *AtomicUint64) Set(n uint64)
type Int64Map ¶
type Int64Map struct {
// contains filtered or unexported fields
}
func NewInt64Map ¶
func NewInt64Map() *Int64Map
type Semaphore ¶
type Semaphore interface {
// Increment the semaphore counter
Release()
// Decrement the semaphore counter, and block if counter < 0
Acquire()
// Decrement the semaphore counter , and block if counter < 0
// Wait for up to the given duration. Returns true if did not timeout
AcquireTimeout(timeout time.Duration) bool
}
func NewSemaphore ¶
Click to show internal directories.
Click to hide internal directories.