Documentation
¶
Index ¶
- Variables
- func AbsInt(i int) int
- func CheckError(action string, err error)
- func ClassLoaderID() int32
- func ClearCompressedFlag(flag int) int
- func FileReadAll(path string) ([]byte, error)
- func GetAddressByBytes(data []byte) string
- func GetTransactionValue(flag int) int
- func HashString(s string) int
- func IsArrayEmpty(i ...interface{}) bool
- func LocalIP() string
- func MakeFileIfNotExist(path string) error
- func MessageClientID() string
- func MinInt(a, b int) int
- func Pid() int16
- func ResetTransactionValue(flag int, typeFlag int) int
- func StrJoin(str, key string, value interface{}) string
- func UnCompress(data []byte) []byte
- func WriteToFile(path string, data []byte) error
- type RingNodesBuffer
- func (rb *RingNodesBuffer) Cap() uint64
- func (r *RingNodesBuffer) Destroy()
- func (r *RingNodesBuffer) Read(timeout time.Duration) (data []byte, err error)
- func (r *RingNodesBuffer) ReadBySize(data []byte, timeout time.Duration) (n int, err error)
- func (r *RingNodesBuffer) Size() uint64
- func (r *RingNodesBuffer) Write(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRequestTimeout for request timeout error ErrRequestTimeout = errors.New("request timeout") ErrMQEmpty = errors.New("MessageQueue is nil") ErrOffset = errors.New("offset < 0") ErrNumbers = errors.New("numbers < 0") )
View Source
var ( CompressedFlag = 0x1 MultiTagsFlag = 0x1 << 1 TransactionNotType = 0 TransactionPreparedType = 0x1 << 2 TransactionCommitType = 0x2 << 2 TransactionRollbackType = 0x3 << 2 )
Functions ¶
func CheckError ¶
func ClassLoaderID ¶
func ClassLoaderID() int32
func ClearCompressedFlag ¶
func FileReadAll ¶
func GetAddressByBytes ¶
func GetTransactionValue ¶
func IsArrayEmpty ¶
func IsArrayEmpty(i ...interface{}) bool
func MakeFileIfNotExist ¶
func MessageClientID ¶
func MessageClientID() string
func ResetTransactionValue ¶
func UnCompress ¶
func WriteToFile ¶
Types ¶
type RingNodesBuffer ¶
type RingNodesBuffer struct {
// contains filtered or unexported fields
}
1.需要能够动态扩容 2.缩容看情况 3.read的时候需要block 4.线程安全
func NewRingNodesBuffer ¶
func NewRingNodesBuffer(cap uint64) *RingNodesBuffer
func (*RingNodesBuffer) Cap ¶
func (rb *RingNodesBuffer) Cap() uint64
Cap returns the capacity of this ring buffer.
func (*RingNodesBuffer) Destroy ¶
func (r *RingNodesBuffer) Destroy()
func (*RingNodesBuffer) Read ¶
func (r *RingNodesBuffer) Read(timeout time.Duration) (data []byte, err error)
直接返回数据
func (*RingNodesBuffer) ReadBySize ¶
知道大小,传进去解析
func (*RingNodesBuffer) Size ¶
func (r *RingNodesBuffer) Size() uint64
func (*RingNodesBuffer) Write ¶
func (r *RingNodesBuffer) Write(b []byte) error
Click to show internal directories.
Click to hide internal directories.