util

package
v0.0.0-...-7b5b11a Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2014 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Daemonize

func Daemonize(nochdir, noclose int) int

func GenerateId

func GenerateId(n int) string

func GetFloatValue

func GetFloatValue(f *expvar.Float) float64

func GetIntValue

func GetIntValue(i *expvar.Int) int64

func MurmurHash

func MurmurHash(data []byte) uint32

func WritePid

func WritePid(pidFile string)

Types

type Balancer

type Balancer struct {
	Prior           int64
	Start           int64
	Total           float64
	ElapsedUseconds int64
	SleepUsec       int64
	PerSec          int
}

func (*Balancer) Execute

func (self *Balancer) Execute(callback func())

type MessageContainer

type MessageContainer struct {
	Message  codec.Message
	Refcount int
	Created  time.Time
	Updated  time.Time
	Opaque   interface{}
}

type MessageTable

type MessageTable struct {
	sync.RWMutex
	Id       uint16
	Hash     map[uint16]*MessageContainer
	OnFinish func(uint16, codec.Message, interface{})
	// contains filtered or unexported fields
}

func NewMessageTable

func NewMessageTable() *MessageTable

func (*MessageTable) Clean

func (self *MessageTable) Clean()

func (*MessageTable) Get

func (self *MessageTable) Get(id uint16) (codec.Message, error)

func (*MessageTable) NewId

func (self *MessageTable) NewId() uint16

func (*MessageTable) Register

func (self *MessageTable) Register(id uint16, message codec.Message, opaque interface{})

func (*MessageTable) Register2

func (self *MessageTable) Register2(id uint16, message codec.Message, count int, opaque interface{})

func (*MessageTable) Remove

func (self *MessageTable) Remove(id uint16)

func (*MessageTable) SetOnFinish

func (self *MessageTable) SetOnFinish(callback func(uint16, codec.Message, interface{}))

func (*MessageTable) Unref

func (self *MessageTable) Unref(id uint16)

type Qlobber

type Qlobber struct {
	Separator    string
	WildcardSome string
	WildcardOne  string
	QlobberTrie  *QlobberTrie
	Mutex        *sync.RWMutex
	Cache        map[string][]interface{}
}

func NewQlobber

func NewQlobber() *Qlobber

func (*Qlobber) Add

func (self *Qlobber) Add(Topic string, Value interface{})

func (*Qlobber) Dump

func (self *Qlobber) Dump(writer io.Writer)

func (*Qlobber) Match

func (self *Qlobber) Match(Topic string) []interface{}

func (*Qlobber) Remove

func (self *Qlobber) Remove(Topic string, val interface{})

type QlobberTrie

type QlobberTrie struct {
	Collections []interface{}
	Trie        map[string]*QlobberTrie
}

Jump to

Keyboard shortcuts

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