Documentation ¶
Overview ¶
Golang的list简直就是辣鸡
Index ¶
- Variables
- type CircleArray
- func (a *CircleArray) Append(v interface{}) error
- func (a *CircleArray) Get(index int) interface{}
- func (a *CircleArray) Init(size int)
- func (a *CircleArray) Len() int
- func (a *CircleArray) Pop() interface{}
- func (a *CircleArray) Push(v interface{})
- func (a *CircleArray) Put(index int, v interface{})
- func (a *CircleArray) Resize(size int)
- type Element
- type Iterator
- type LeakyBucket
- type LinkedList
- type SpinLock
Constants ¶
This section is empty.
Variables ¶
View Source
var OutOfCapacity = errors.New("Out of capacity")
Functions ¶
This section is empty.
Types ¶
type CircleArray ¶
type CircleArray struct {
// contains filtered or unexported fields
}
func (*CircleArray) Append ¶
func (a *CircleArray) Append(v interface{}) error
func (*CircleArray) Get ¶
func (a *CircleArray) Get(index int) interface{}
func (*CircleArray) Init ¶
func (a *CircleArray) Init(size int)
func (*CircleArray) Len ¶
func (a *CircleArray) Len() int
func (*CircleArray) Pop ¶
func (a *CircleArray) Pop() interface{}
func (*CircleArray) Push ¶
func (a *CircleArray) Push(v interface{})
func (*CircleArray) Put ¶
func (a *CircleArray) Put(index int, v interface{})
func (*CircleArray) Resize ¶
func (a *CircleArray) Resize(size int)
type LeakyBucket ¶
type LeakyBucket struct {
// contains filtered or unexported fields
}
func (*LeakyBucket) Acquire ¶
func (b *LeakyBucket) Acquire(size uint64) bool
func (*LeakyBucket) Close ¶
func (b *LeakyBucket) Close()
func (*LeakyBucket) Init ¶
func (b *LeakyBucket) Init(rate uint64)
func (*LeakyBucket) SetRate ¶
func (b *LeakyBucket) SetRate(rate uint64)
type LinkedList ¶
type LinkedList struct {
// contains filtered or unexported fields
}
func (*LinkedList) Iterator ¶
func (q *LinkedList) Iterator() Iterator
func (*LinkedList) Len ¶
func (q *LinkedList) Len() int
func (*LinkedList) PopFront ¶
func (q *LinkedList) PopFront() interface{}
func (*LinkedList) PushBack ¶
func (q *LinkedList) PushBack(v interface{})
func (*LinkedList) PushFront ¶
func (q *LinkedList) PushFront(v interface{})
func (*LinkedList) Remove ¶
func (q *LinkedList) Remove(filter func(interface{}) bool)
type SpinLock ¶
type SpinLock struct {
// contains filtered or unexported fields
}
SpinLock implements a simple atomic spin lock, the zero value for a SpinLock is an unlocked spinlock.
func (*SpinLock) Lock ¶
func (sl *SpinLock) Lock()
Lock locks sl. If the lock is already in use, the caller blocks until Unlock is called
func (*SpinLock) TryLock ¶
TryLock will try to lock sl and return whether it succeed or not without blocking.
func (*SpinLock) Unlock ¶
func (sl *SpinLock) Unlock()
Unlock unlocks sl, unlike [Mutex.Unlock](http://golang.org/pkg/sync/#Mutex.Unlock), there's no harm calling it on an unlocked SpinLock
Click to show internal directories.
Click to hide internal directories.