Documentation
¶
Index ¶
- func AccumulativeBufToBytes(dst []byte, val interface{}) ([]byte, error)
- func ChainBufToBytes(dst []byte, val interface{}) ([]byte, error)
- type AccumulativeBuf
- func (b *AccumulativeBuf) Bytes() []byte
- func (b *AccumulativeBuf) BytesCopy() []byte
- func (b *AccumulativeBuf) Cap() int
- func (b AccumulativeBuf) Error() error
- func (b *AccumulativeBuf) Grow(newLen int) *AccumulativeBuf
- func (b *AccumulativeBuf) GrowDelta(delta int) *AccumulativeBuf
- func (b *AccumulativeBuf) Len() int
- func (b *AccumulativeBuf) RangeBytes(off, len int) []byte
- func (b *AccumulativeBuf) RangeBytesCopy(off, len int) []byte
- func (b *AccumulativeBuf) RangeString(off, len int) string
- func (b *AccumulativeBuf) RangeStringCopy(off, len int) string
- func (b *AccumulativeBuf) Replace(old, new []byte, n int) *AccumulativeBuf
- func (b *AccumulativeBuf) ReplaceAll(old, new []byte) *AccumulativeBuf
- func (b *AccumulativeBuf) ReplaceStr(old, new string, n int) *AccumulativeBuf
- func (b *AccumulativeBuf) ReplaceStrAll(old, new string) *AccumulativeBuf
- func (b *AccumulativeBuf) Reset() *AccumulativeBuf
- func (b *AccumulativeBuf) StakeOut() *AccumulativeBuf
- func (b *AccumulativeBuf) StakedBytes() []byte
- func (b *AccumulativeBuf) StakedBytesCopy() []byte
- func (b *AccumulativeBuf) StakedLen() int
- func (b *AccumulativeBuf) StakedOffset() int
- func (b *AccumulativeBuf) StakedString() string
- func (b *AccumulativeBuf) StakedStringCopy() string
- func (b *AccumulativeBuf) String() string
- func (b *AccumulativeBuf) StringCopy() string
- func (b *AccumulativeBuf) Write(p []byte) *AccumulativeBuf
- func (b *AccumulativeBuf) WriteBool(v bool) *AccumulativeBuf
- func (b *AccumulativeBuf) WriteByte(p byte) *AccumulativeBuf
- func (b *AccumulativeBuf) WriteFloat(f float64) *AccumulativeBuf
- func (b *AccumulativeBuf) WriteInt(i int64) *AccumulativeBuf
- func (b *AccumulativeBuf) WriteMarshallerTo(m MarshallerTo) *AccumulativeBuf
- func (b *AccumulativeBuf) WriteStr(s string) *AccumulativeBuf
- func (b *AccumulativeBuf) WriteUint(u uint64) *AccumulativeBuf
- func (b *AccumulativeBuf) WriteX(x interface{}) *AccumulativeBuf
- type ChainBuf
- func (b *ChainBuf) Bytes() []byte
- func (b *ChainBuf) BytesCopy() []byte
- func (b *ChainBuf) Cap() int
- func (b *ChainBuf) Grow(newLen int) *ChainBuf
- func (b *ChainBuf) GrowDelta(delta int) *ChainBuf
- func (b *ChainBuf) Len() int
- func (b *ChainBuf) Replace(old, new []byte, n int) *ChainBuf
- func (b *ChainBuf) ReplaceAll(old, new []byte) *ChainBuf
- func (b *ChainBuf) ReplaceStr(old, new string, n int) *ChainBuf
- func (b *ChainBuf) ReplaceStrAll(old, new string) *ChainBuf
- func (b *ChainBuf) Reset() *ChainBuf
- func (b *ChainBuf) String() string
- func (b *ChainBuf) StringCopy() string
- func (b *ChainBuf) Write(p []byte) *ChainBuf
- func (b *ChainBuf) WriteBool(v bool) *ChainBuf
- func (b *ChainBuf) WriteByte(p byte) *ChainBuf
- func (b *ChainBuf) WriteFloat(f float64) *ChainBuf
- func (b *ChainBuf) WriteInt(i int64) *ChainBuf
- func (b *ChainBuf) WriteMarshallerTo(m MarshallerTo) *ChainBuf
- func (b *ChainBuf) WriteStr(s string) *ChainBuf
- func (b *ChainBuf) WriteUint(u uint64) *ChainBuf
- func (b *ChainBuf) WriteX(x interface{}) *ChainBuf
- type MarshallerTo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccumulativeBufToBytes ¶
Conversion to bytes function.
func ChainBufToBytes ¶
Conversion to bytes function.
Types ¶
type AccumulativeBuf ¶
type AccumulativeBuf struct {
// contains filtered or unexported fields
}
A wrapper around ChainBuf that allows to accumulate buffer data and use only necessary part.
See StakeOut and Staked* methods.
func (*AccumulativeBuf) Bytes ¶
func (b *AccumulativeBuf) Bytes() []byte
Get contents of the buffer.
func (*AccumulativeBuf) BytesCopy ¶
func (b *AccumulativeBuf) BytesCopy() []byte
Get copy of the buffer.
func (AccumulativeBuf) Error ¶
func (b AccumulativeBuf) Error() error
Get last error caught in Write* methods.
func (*AccumulativeBuf) Grow ¶
func (b *AccumulativeBuf) Grow(newLen int) *AccumulativeBuf
Grow length of the buffer.
func (*AccumulativeBuf) GrowDelta ¶
func (b *AccumulativeBuf) GrowDelta(delta int) *AccumulativeBuf
Grow length of the buffer to actual length + delta.
See Grow().
func (*AccumulativeBuf) RangeBytes ¶
func (b *AccumulativeBuf) RangeBytes(off, len int) []byte
Get buffer bytes from offset off with length len.
func (*AccumulativeBuf) RangeBytesCopy ¶
func (b *AccumulativeBuf) RangeBytesCopy(off, len int) []byte
Copy version of RangeBytes().
func (*AccumulativeBuf) RangeString ¶
func (b *AccumulativeBuf) RangeString(off, len int) string
Get buffer bytes as string from offset off with length len.
func (*AccumulativeBuf) RangeStringCopy ¶
func (b *AccumulativeBuf) RangeStringCopy(off, len int) string
Copy version of RangeString().
func (*AccumulativeBuf) Replace ¶
func (b *AccumulativeBuf) Replace(old, new []byte, n int) *AccumulativeBuf
Replace old to new bytes in buffer.
func (*AccumulativeBuf) ReplaceAll ¶
func (b *AccumulativeBuf) ReplaceAll(old, new []byte) *AccumulativeBuf
Replace all old to new bytes in buffer.
func (*AccumulativeBuf) ReplaceStr ¶
func (b *AccumulativeBuf) ReplaceStr(old, new string, n int) *AccumulativeBuf
Replace old to new strings in buffer.
func (*AccumulativeBuf) ReplaceStrAll ¶
func (b *AccumulativeBuf) ReplaceStrAll(old, new string) *AccumulativeBuf
Replace all old to new strings in buffer.
func (*AccumulativeBuf) Reset ¶
func (b *AccumulativeBuf) Reset() *AccumulativeBuf
Reset length of the buffer.
func (*AccumulativeBuf) StakeOut ¶
func (b *AccumulativeBuf) StakeOut() *AccumulativeBuf
Stake out current offset for further use.
func (*AccumulativeBuf) StakedBytes ¶
func (b *AccumulativeBuf) StakedBytes() []byte
Get accumulated bytes from staked offset.
func (*AccumulativeBuf) StakedBytesCopy ¶
func (b *AccumulativeBuf) StakedBytesCopy() []byte
Get copy of accumulated bytes from staked offset.
func (*AccumulativeBuf) StakedLen ¶
func (b *AccumulativeBuf) StakedLen() int
Get length of accumulated bytes.
func (*AccumulativeBuf) StakedOffset ¶
func (b *AccumulativeBuf) StakedOffset() int
Get staked offset.
func (*AccumulativeBuf) StakedString ¶
func (b *AccumulativeBuf) StakedString() string
Get accumulated bytes as string.
func (*AccumulativeBuf) StakedStringCopy ¶
func (b *AccumulativeBuf) StakedStringCopy() string
Get copy of accumulated bytes as string.
func (*AccumulativeBuf) String ¶
func (b *AccumulativeBuf) String() string
Get contents of the buffer as string.
func (*AccumulativeBuf) StringCopy ¶
func (b *AccumulativeBuf) StringCopy() string
Get copy of the buffer as string.
func (*AccumulativeBuf) Write ¶
func (b *AccumulativeBuf) Write(p []byte) *AccumulativeBuf
Write bytes to the buffer.
func (*AccumulativeBuf) WriteBool ¶
func (b *AccumulativeBuf) WriteBool(v bool) *AccumulativeBuf
Write boolean value to the buffer.
func (*AccumulativeBuf) WriteByte ¶
func (b *AccumulativeBuf) WriteByte(p byte) *AccumulativeBuf
Write single byte.
func (*AccumulativeBuf) WriteFloat ¶
func (b *AccumulativeBuf) WriteFloat(f float64) *AccumulativeBuf
Write float value to the buffer.
func (*AccumulativeBuf) WriteInt ¶
func (b *AccumulativeBuf) WriteInt(i int64) *AccumulativeBuf
Write integer value to the buffer.
func (*AccumulativeBuf) WriteMarshallerTo ¶
func (b *AccumulativeBuf) WriteMarshallerTo(m MarshallerTo) *AccumulativeBuf
Marshal data of struct implemented MarshallerTo interface.
func (*AccumulativeBuf) WriteStr ¶
func (b *AccumulativeBuf) WriteStr(s string) *AccumulativeBuf
Write string to the buffer.
func (*AccumulativeBuf) WriteUint ¶
func (b *AccumulativeBuf) WriteUint(u uint64) *AccumulativeBuf
Write unsigned integer value to the buffer.
func (*AccumulativeBuf) WriteX ¶
func (b *AccumulativeBuf) WriteX(x interface{}) *AccumulativeBuf
Write v with arbitrary type to the buffer.
type ChainBuf ¶
type ChainBuf []byte
Primitive byte buffer with chain call support.
func (*ChainBuf) ReplaceAll ¶
Replace all old to new bytes in buffer.
func (*ChainBuf) ReplaceStr ¶
Replace old to new strings in buffer.
func (*ChainBuf) ReplaceStrAll ¶
Replace all old to new strings in buffer.
func (*ChainBuf) StringCopy ¶
Get copy of the buffer as string.
func (*ChainBuf) WriteFloat ¶
Write float value to the buffer.
func (*ChainBuf) WriteMarshallerTo ¶
func (b *ChainBuf) WriteMarshallerTo(m MarshallerTo) *ChainBuf
Marshal data of struct implemented MarshallerTo interface.