container

package
v1.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MIN_TIMER_INTERVAL = 1 * time.Millisecond
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitmap

type Bitmap []uint32

func (*Bitmap) Clone

func (b *Bitmap) Clone() *Bitmap

func (*Bitmap) Exists

func (b *Bitmap) Exists(item uint32) bool

func (*Bitmap) Grow

func (b *Bitmap) Grow(item uint32)

func (*Bitmap) Init

func (b *Bitmap) Init(maxNum uint32)

func (*Bitmap) Inverse

func (b *Bitmap) Inverse()

func (*Bitmap) MaxU

func (b *Bitmap) MaxU(x, y uint32) uint32

func (*Bitmap) Min

func (b *Bitmap) Min(x, y int) int

func (*Bitmap) Set

func (b *Bitmap) Set(item uint32) bool

func (*Bitmap) Sets

func (b *Bitmap) Sets(items []uint32)

func (*Bitmap) Union

func (b *Bitmap) Union(b2 *Bitmap) *Bitmap

type CHash

type CHash interface {
	Adds([]CHashNode)
	Del(id string)
	Get(key string) CHashNode
}

type CHashNode

type CHashNode interface {
	Id() string
	Health() bool
}

type CHashRing

type CHashRing struct {
	// contains filtered or unexported fields
}

func (*CHashRing) Adds

func (c *CHashRing) Adds(nodes []CHashNode)

func (*CHashRing) Debug

func (c *CHashRing) Debug() string

func (*CHashRing) Del

func (c *CHashRing) Del(nodeId string)

func (*CHashRing) Get

func (c *CHashRing) Get(key string) CHashNode

type CallbackFunc

type CallbackFunc func(uint) (done bool)

定时执行函数 入参回调执行序号(次数) 回参是否完成,true停止执行,false继续执行,在dealine的callback中无效

type DataRow

type DataRow struct {
	// contains filtered or unexported fields
}

func (*DataRow) Data

func (r *DataRow) Data() []string

func (*DataRow) Int64 added in v1.0.16

func (r *DataRow) Int64(fieldName string) int64

func (*DataRow) String

func (r *DataRow) String(fieldName string) string

func (*DataRow) UInt64 added in v1.0.16

func (r *DataRow) UInt64(fieldName string) uint64

type DataSet

type DataSet map[string]*DataTable

func (DataSet) Table

func (s DataSet) Table(tName string) *DataTable

type DataTable

type DataTable struct {
	// contains filtered or unexported fields
}

func NewDataTable

func NewDataTable(cols []string, pkCol string, indexes []string, initCap int) *DataTable

func (*DataTable) Cols added in v1.0.17

func (t *DataTable) Cols() []string

meta info

func (*DataTable) Indexes added in v1.0.17

func (t *DataTable) Indexes() []string

func (*DataTable) PkCol added in v1.0.17

func (t *DataTable) PkCol() string

func (*DataTable) PkInt

func (t *DataTable) PkInt(row *DataRow) int

func (*DataTable) PkString

func (t *DataTable) PkString(row *DataRow) string

func (*DataTable) Push

func (t *DataTable) Push(row []string)

func (*DataTable) PushAll

func (t *DataTable) PushAll(rows [][]string)

func (*DataTable) Row

func (t *DataTable) Row(pk string) *DataRow

data info

func (*DataTable) Rows

func (t *DataTable) Rows() (rows []*DataRow)

func (*DataTable) RowsBy

func (t *DataTable) RowsBy(indexName, indexValue string) []*DataRow

type LightTimer

type LightTimer struct {
	// contains filtered or unexported fields
}

func NewLightTimer

func NewLightTimer() *LightTimer

func (*LightTimer) AddCallback

func (lt *LightTimer) AddCallback(d time.Duration, callback func()) *Timer

Add a callback which will be called after specified duration

func (*LightTimer) AddTimer

func (lt *LightTimer) AddTimer(d time.Duration, callback CallbackFunc) *Timer

func (*LightTimer) AddTimerWithDeadline

func (lt *LightTimer) AddTimerWithDeadline(d time.Duration, deadline time.Time, callback CallbackFunc, deadlineCallback CallbackFunc) *Timer

Add a timer which calls callback periodly

func (*LightTimer) StartTicks

func (lt *LightTimer) StartTicks(tickInterval time.Duration)

Start the self-ticking routine, which ticks per tickInterval

type LightTimerPool

type LightTimerPool struct {
	// contains filtered or unexported fields
}

func NewLightTimerPool

func NewLightTimerPool(size int, tickInterval time.Duration) *LightTimerPool

func (*LightTimerPool) AddCallback

func (p *LightTimerPool) AddCallback(key string, d time.Duration, callback func())

func (*LightTimerPool) AddTimer

func (p *LightTimerPool) AddTimer(key string, d time.Duration, callback CallbackFunc)

func (*LightTimerPool) AddTimerWithDeadline

func (p *LightTimerPool) AddTimerWithDeadline(key string, d time.Duration, deadline time.Time,
	callback CallbackFunc, deadlineCallback CallbackFunc)

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

func (*Timer) Cancel

func (t *Timer) Cancel()

func (*Timer) IsActive

func (t *Timer) IsActive() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL