lib

package
v0.0.0-...-6496225 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: MIT, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	In    = "in"
	Out   = "out"
	InOut = "inout"

	Publish = "PUBLISH"
	LPush   = "LPUSH"
	RPush   = "RPUSH"

	Subscribe       = "SUBSCRIBE"
	PSubscribe      = "PSUBSCRIBE"
	RPop            = "RPOP"
	LPop            = "LPOP"
	BrPop           = "BRPOP"
	BlPop           = "BLPOP"
	PSubscribechars = "*?[]"

	RecStart uint32 = 12345
	RecStop  uint32 = 54321

	MinBufferSize  = 8 * 1024
	MaxBufferSize  = 10 * 1024 * 1024
	MinBufferCount = 10
	MaxBufferCount = 1000

	DefaultOutBulkCount = 50

	MinLogSize = 2 * 1024
	MaxLogSize = 10 * 1024 * 1024

	DayAsSec  = 60 * 60 * 24
	DayAsMSec = DayAsSec * 1000

	InvalidMessageSize = 1024 * 1024
	ISO8601Time        = "2006-01-02T15:04:05.999-07:00"

	TCPUDPMsgStart = "///*["
	TCPUDPMsgEnd   = "]*\\\\\\"

	Byte  = 1
	KByte = 1024 * Byte
	MByte = 1024 * KByte
	GByte = 1024 * MByte
)

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

func Compress

func Compress(data []byte, compType CompressionType) []byte

func Decompress

func Decompress(data []byte, compType CompressionType) []byte

func FileExists

func FileExists(fileName string) (bool, error)

func IsReadTimeoutError

func IsReadTimeoutError(err error) bool

func IsTimeoutError

func IsTimeoutError(err error) bool

func IsWriteTimeoutError

func IsWriteTimeoutError(err error) bool

func LoadClientCert

func LoadClientCert(certFile, keyFile, caFile string, verifySsl bool) (config *tls.Config, err error)

func LoadServerCert

func LoadServerCert(certFile, keyFile, caFile string, verifySsl bool) (config *tls.Config, err error)

func MaxDuration

func MaxDuration(a, b time.Duration) time.Duration

func MaxFloat32

func MaxFloat32(a, b float32) float32

func MaxFloat64

func MaxFloat64(a, b float64) float64

func MaxInt

func MaxInt(a, b int) int

func MaxInt16

func MaxInt16(a, b int16) int16

func MaxInt32

func MaxInt32(a, b int32) int32

func MaxInt64

func MaxInt64(a, b int64) int64

func MinDuration

func MinDuration(a, b time.Duration) time.Duration

func MinFloat32

func MinFloat32(a, b float32) float32

func MinFloat64

func MinFloat64(a, b float64) float64

func MinInt

func MinInt(a, b int) int

func MinInt16

func MinInt16(a, b int16) int16

func MinInt32

func MinInt32(a, b int32) int32

func MinInt64

func MinInt64(a, b int64) int64

func NewLine

func NewLine() []byte

func PathExists

func PathExists(path string) (bool, error)

func PrepareFile

func PrepareFile(filename string) string

func PreparePath

func PreparePath(dir string) string

func RecStartBytes

func RecStartBytes() []byte

func RecStopBytes

func RecStopBytes() []byte

Types

type Chan

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

func MakeChan

func MakeChan(typ reflect.Type) *Chan

func MakeChanBool

func MakeChanBool() *Chan

func MakeChanBuffered

func MakeChanBuffered(typ reflect.Type, size int) *Chan

func MakeChanBufferedBool

func MakeChanBufferedBool(size int) *Chan

func MakeChanBufferedByte

func MakeChanBufferedByte(size int) *Chan

func MakeChanBufferedByteArray

func MakeChanBufferedByteArray(size int) *Chan

func MakeChanBufferedFloat32

func MakeChanBufferedFloat32(size int) *Chan

func MakeChanBufferedFloat64

func MakeChanBufferedFloat64(size int) *Chan

func MakeChanBufferedInt

func MakeChanBufferedInt(size int) *Chan

func MakeChanBufferedInt16

func MakeChanBufferedInt16(size int) *Chan

func MakeChanBufferedInt32

func MakeChanBufferedInt32(size int) *Chan

func MakeChanBufferedInt64

func MakeChanBufferedInt64(size int) *Chan

func MakeChanBufferedInt8

func MakeChanBufferedInt8(size int) *Chan

func MakeChanBufferedString

func MakeChanBufferedString(size int) *Chan

func MakeChanBufferedUint

func MakeChanBufferedUint(size int) *Chan

func MakeChanBufferedUint16

func MakeChanBufferedUint16(size int) *Chan

func MakeChanBufferedUint32

func MakeChanBufferedUint32(size int) *Chan

func MakeChanBufferedUint64

func MakeChanBufferedUint64(size int) *Chan

func MakeChanBufferedUint8

func MakeChanBufferedUint8(size int) *Chan

func MakeChanByte

func MakeChanByte() *Chan

func MakeChanByteArray

func MakeChanByteArray() *Chan

func MakeChanFloat32

func MakeChanFloat32() *Chan

func MakeChanFloat64

func MakeChanFloat64() *Chan

func MakeChanInt

func MakeChanInt() *Chan

func MakeChanInt16

func MakeChanInt16() *Chan

func MakeChanInt32

func MakeChanInt32() *Chan

func MakeChanInt64

func MakeChanInt64() *Chan

func MakeChanInt8

func MakeChanInt8() *Chan

func MakeChanString

func MakeChanString() *Chan

func MakeChanUint

func MakeChanUint() *Chan

func MakeChanUint16

func MakeChanUint16() *Chan

func MakeChanUint32

func MakeChanUint32() *Chan

func MakeChanUint64

func MakeChanUint64() *Chan

func MakeChanUint8

func MakeChanUint8() *Chan

func (*Chan) AssumeReceived

func (c *Chan) AssumeReceived()

func (*Chan) AssumeReceiving

func (c *Chan) AssumeReceiving() bool

func (*Chan) Close

func (c *Chan) Close() bool

func (*Chan) Closed

func (c *Chan) Closed() bool

func (*Chan) Kind

func (c *Chan) Kind() reflect.Kind

func (*Chan) Receive

func (c *Chan) Receive() (v reflect.Value, stat ChanActionStatus)

func (*Chan) ReceiveBool

func (c *Chan) ReceiveBool() (val bool, stat ChanActionStatus)

func (*Chan) ReceiveByte

func (c *Chan) ReceiveByte() (val byte, stat ChanActionStatus)

func (*Chan) ReceiveByteArray

func (c *Chan) ReceiveByteArray() (val []byte, stat ChanActionStatus)

func (*Chan) ReceiveFloat32

func (c *Chan) ReceiveFloat32() (val float32, stat ChanActionStatus)

func (*Chan) ReceiveFloat64

func (c *Chan) ReceiveFloat64() (val float64, stat ChanActionStatus)

func (*Chan) ReceiveInt

func (c *Chan) ReceiveInt() (val int, stat ChanActionStatus)

func (*Chan) ReceiveInt16

func (c *Chan) ReceiveInt16() (val int16, stat ChanActionStatus)

func (*Chan) ReceiveInt32

func (c *Chan) ReceiveInt32() (val int32, stat ChanActionStatus)

func (*Chan) ReceiveInt64

func (c *Chan) ReceiveInt64() (val int64, stat ChanActionStatus)

func (*Chan) ReceiveInt8

func (c *Chan) ReceiveInt8() (val int8, stat ChanActionStatus)

func (*Chan) ReceiveString

func (c *Chan) ReceiveString() (val string, stat ChanActionStatus)

func (*Chan) ReceiveUint

func (c *Chan) ReceiveUint() (val uint, stat ChanActionStatus)

func (*Chan) ReceiveUint16

func (c *Chan) ReceiveUint16() (val uint16, stat ChanActionStatus)

func (*Chan) ReceiveUint32

func (c *Chan) ReceiveUint32() (val uint32, stat ChanActionStatus)

func (*Chan) ReceiveUint64

func (c *Chan) ReceiveUint64() (val uint64, stat ChanActionStatus)

func (*Chan) ReceiveUint8

func (c *Chan) ReceiveUint8() (val uint8, stat ChanActionStatus)

func (*Chan) Send

func (c *Chan) Send(v reflect.Value) bool

func (*Chan) SendBool

func (c *Chan) SendBool(val bool) bool

func (*Chan) SendByte

func (c *Chan) SendByte(val byte) bool

func (*Chan) SendByteArray

func (c *Chan) SendByteArray(val []byte) bool

func (*Chan) SendFloat32

func (c *Chan) SendFloat32(val float32) bool

func (*Chan) SendFloat64

func (c *Chan) SendFloat64(val float64) bool

func (*Chan) SendInt

func (c *Chan) SendInt(val int) bool

func (*Chan) SendInt16

func (c *Chan) SendInt16(val int16) bool

func (*Chan) SendInt32

func (c *Chan) SendInt32(val int32) bool

func (*Chan) SendInt64

func (c *Chan) SendInt64(val int64) bool

func (*Chan) SendInt8

func (c *Chan) SendInt8(val int8) bool

func (*Chan) SendString

func (c *Chan) SendString(val string) bool

func (*Chan) SendUint

func (c *Chan) SendUint(val uint) bool

func (*Chan) SendUint16

func (c *Chan) SendUint16(val uint16) bool

func (*Chan) SendUint32

func (c *Chan) SendUint32(val uint32) bool

func (*Chan) SendUint64

func (c *Chan) SendUint64(val uint64) bool

func (*Chan) SendUint8

func (c *Chan) SendUint8(val uint8) bool

func (*Chan) Size

func (c *Chan) Size() int

func (*Chan) UnderlyingChan

func (c *Chan) UnderlyingChan() *reflect.Value

type ChanActionStatus

type ChanActionStatus int
const (
	ChanNotOK ChanActionStatus = iota
	ChanOK
	ChanError
	ChanClosed
)

type CompressionType

type CompressionType int
const (
	CtGZip CompressionType = iota
	CtZip
)

type FileInfo

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

func NewFileInfo

func NewFileInfo(name string, date time.Time, size uint64) *FileInfo

func (*FileInfo) Date

func (f *FileInfo) Date() time.Time

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Size

func (f *FileInfo) Size() uint64

type FileInfoList

type FileInfoList []*FileInfo

func (FileInfoList) Len

func (f FileInfoList) Len() int

func (FileInfoList) Less

func (f FileInfoList) Less(i, j int) bool

func (FileInfoList) Swap

func (f FileInfoList) Swap(i, j int)

type JsonPath

type JsonPath struct {
	Type  JsonPathType
	Parts []JsonPathPart
}

func NewJsonPath

func NewJsonPath(s string) *JsonPath

func (*JsonPath) Eval

func (jp *JsonPath) Eval(jsonData interface{}, trimSpace bool) (interface{}, error)

func (*JsonPath) EvalString

func (jp *JsonPath) EvalString(jsonData string, trimSpace bool) (result interface{}, err error)

func (*JsonPath) IsStatic

func (jp *JsonPath) IsStatic() bool

func (*JsonPath) String

func (jp *JsonPath) String() string

type JsonPathPart

type JsonPathPart struct {
	Data  string
	Type  JsonPathPartType
	Start int
	Len   int
}

func (*JsonPathPart) IsStatic

func (jp *JsonPathPart) IsStatic() bool

func (*JsonPathPart) String

func (jp *JsonPathPart) String() string

type JsonPathPartType

type JsonPathPartType int
const (
	JPPStatic JsonPathPartType = iota
	JPPDynamic
)

func (JsonPathPartType) String

func (jt JsonPathPartType) String() string

type JsonPathType

type JsonPathType int
const (
	JPStatic JsonPathType = iota
	JPComplex
)

func (JsonPathType) String

func (jt JsonPathType) String() string

type LogType

type LogType int
const (
	LogRolling LogType = iota
	LogAppend
)

type ServiceMode

type ServiceMode int
const (
	SmIn ServiceMode = iota
	SmOut
	SmInOut
)

type UUID

type UUID [16]byte

func NewUUID

func NewUUID() (*UUID, error)

func ParseUUID

func ParseUUID(uuid string) (*UUID, error)

func (UUID) String

func (uuid UUID) String() string

func (UUID) StringWithoutSep

func (uuid UUID) StringWithoutSep() string

type WorkGroup

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

func (*WorkGroup) Add

func (w *WorkGroup) Add(delta int)

func (*WorkGroup) Close

func (w *WorkGroup) Close()

func (*WorkGroup) Count

func (w *WorkGroup) Count() int

func (*WorkGroup) Done

func (w *WorkGroup) Done()

func (*WorkGroup) Wait

func (w *WorkGroup) Wait()

Jump to

Keyboard shortcuts

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