Documentation ¶
Index ¶
- func AccumulativeToBytes(dst []byte, val any) ([]byte, error)
- func ChainToBytes(dst []byte, val any) ([]byte, error)
- type AccBufWriter
- type Accumulative
- func (b *Accumulative) Bytes() []byte
- func (b *Accumulative) BytesCopy() []byte
- func (b *Accumulative) Cap() int
- func (b *Accumulative) Error() error
- func (b *Accumulative) Grow(newLen int) *Accumulative
- func (b *Accumulative) GrowDelta(delta int) *Accumulative
- func (b *Accumulative) Len() int
- func (b *Accumulative) RangeBytes(off, len int) []byte
- func (b *Accumulative) RangeBytesCopy(off, len int) []byte
- func (b *Accumulative) RangeString(off, len int) string
- func (b *Accumulative) RangeStringCopy(off, len int) string
- func (b *Accumulative) Replace(old, new []byte, n int) *Accumulative
- func (b *Accumulative) ReplaceAll(old, new []byte) *Accumulative
- func (b *Accumulative) ReplaceStr(old, new string, n int) *Accumulative
- func (b *Accumulative) ReplaceStrAll(old, new string) *Accumulative
- func (b *Accumulative) ReplaceString(old, new string, n int) *Accumulative
- func (b *Accumulative) ReplaceStringAll(old, new string) *Accumulative
- func (b *Accumulative) Reset() *Accumulative
- func (b *Accumulative) StakeOut() *Accumulative
- func (b *Accumulative) StakedBytes() []byte
- func (b *Accumulative) StakedBytesCopy() []byte
- func (b *Accumulative) StakedLen() int
- func (b *Accumulative) StakedOffset() int
- func (b *Accumulative) StakedString() string
- func (b *Accumulative) StakedStringCopy() string
- func (b *Accumulative) String() string
- func (b *Accumulative) StringCopy() string
- func (b *Accumulative) ToWriter() *AccumulativeWriter
- func (b *Accumulative) Write(p []byte) *Accumulative
- func (b *Accumulative) WriteApplyFn(p []byte, fn func(dst, p []byte) []byte) *Accumulative
- func (b *Accumulative) WriteApplyFnIf(cond bool, p []byte, fn func(dst, p []byte) []byte) *Accumulative
- func (b *Accumulative) WriteApplyFnStr(s string, fn func(dst, p []byte) []byte) *Accumulative
- func (b *Accumulative) WriteApplyFnString(s string, fn func(dst, p []byte) []byte) *Accumulative
- func (b *Accumulative) WriteApplyFnStringIf(cond bool, s string, fn func(dst, p []byte) []byte) *Accumulative
- func (b *Accumulative) WriteBool(v bool) *Accumulative
- func (b *Accumulative) WriteBoolIf(cond bool, v bool) *Accumulative
- func (b *Accumulative) WriteByte(p byte) *Accumulative
- func (b *Accumulative) WriteByteIf(cond bool, p byte) *Accumulative
- func (b *Accumulative) WriteFloat(f float64) *Accumulative
- func (b *Accumulative) WriteFloatIf(cond bool, f float64) *Accumulative
- func (b *Accumulative) WriteIf(cond bool, p []byte) *Accumulative
- func (b *Accumulative) WriteInt(i int64) *Accumulative
- func (b *Accumulative) WriteIntIf(cond bool, i int64) *Accumulative
- func (b *Accumulative) WriteMarshallerTo(m MarshallerTo) *Accumulative
- func (b *Accumulative) WriteMarshallerToIf(cond bool, m MarshallerTo) *Accumulative
- func (b *Accumulative) WriteStr(s string) *Accumulative
- func (b *Accumulative) WriteString(s string) *Accumulative
- func (b *Accumulative) WriteStringIf(cond bool, s string) *Accumulative
- func (b *Accumulative) WriteUint(u uint64) *Accumulative
- func (b *Accumulative) WriteUintIf(cond bool, u uint64) *Accumulative
- func (b *Accumulative) WriteX(x any) *Accumulative
- func (b *Accumulative) WriteXIf(cond bool, x any) *Accumulative
- type AccumulativeBuf
- type AccumulativeWriter
- func (b AccumulativeWriter) Bytes() []byte
- func (b AccumulativeWriter) Cap() int
- func (b AccumulativeWriter) Len() int
- func (b AccumulativeWriter) Reset()
- func (b AccumulativeWriter) String() string
- func (b AccumulativeWriter) Write(p []byte) (int, error)
- func (b AccumulativeWriter) WriteApplyFn(p []byte, fn func(dst, p []byte) []byte) (int, error)
- func (b AccumulativeWriter) WriteApplyFnString(s string, fn func(dst, p []byte) []byte) (int, error)
- func (b AccumulativeWriter) WriteBool(b_ bool) (int, error)
- func (b AccumulativeWriter) WriteByte(p byte) error
- func (b AccumulativeWriter) WriteFloat(f float64) (int, error)
- func (b AccumulativeWriter) WriteInt(i int64) (int, error)
- func (b AccumulativeWriter) WriteMarshallerTo(m MarshallerTo) (int, error)
- func (b AccumulativeWriter) WriteString(s string) (int, error)
- func (b AccumulativeWriter) WriteUint(u uint64) (int, error)
- func (b AccumulativeWriter) WriteX(x any) (int, error)
- type Chain
- func (b *Chain) Bytes() []byte
- func (b *Chain) BytesCopy() []byte
- func (b *Chain) Cap() int
- func (b *Chain) Grow(newLen int) *Chain
- func (b *Chain) GrowDelta(delta int) *Chain
- func (b *Chain) Len() int
- func (b *Chain) Replace(old, new []byte, n int) *Chain
- func (b *Chain) ReplaceAll(old, new []byte) *Chain
- func (b *Chain) ReplaceStr(old, new string, n int) *Chain
- func (b *Chain) ReplaceStrAll(old, new string) *Chain
- func (b *Chain) ReplaceString(old, new string, n int) *Chain
- func (b *Chain) ReplaceStringAll(old, new string) *Chain
- func (b *Chain) Reset() *Chain
- func (b *Chain) String() string
- func (b *Chain) StringCopy() string
- func (b *Chain) Write(p []byte) *Chain
- func (b *Chain) WriteApplyFn(p []byte, fn func(dst, p []byte) []byte) *Chain
- func (b *Chain) WriteApplyFnIf(cond bool, p []byte, fn func(dst, p []byte) []byte) *Chain
- func (b *Chain) WriteApplyFnStr(s string, fn func(dst, p []byte) []byte) *Chain
- func (b *Chain) WriteApplyFnString(s string, fn func(dst, p []byte) []byte) *Chain
- func (b *Chain) WriteApplyFnStringIf(cond bool, s string, fn func(dst, p []byte) []byte) *Chain
- func (b *Chain) WriteBool(v bool) *Chain
- func (b *Chain) WriteBoolIf(cond bool, v bool) *Chain
- func (b *Chain) WriteByte(p byte) *Chain
- func (b *Chain) WriteByteIf(cond bool, p byte) *Chain
- func (b *Chain) WriteFloat(f float64) *Chain
- func (b *Chain) WriteFloatIf(cond bool, f float64) *Chain
- func (b *Chain) WriteIf(cond bool, p []byte) *Chain
- func (b *Chain) WriteInt(i int64) *Chain
- func (b *Chain) WriteIntIf(cond bool, i int64) *Chain
- func (b *Chain) WriteMarshallerTo(m MarshallerTo) *Chain
- func (b *Chain) WriteMarshallerToIf(cond bool, m MarshallerTo) *Chain
- func (b *Chain) WriteStr(s string) *Chain
- func (b *Chain) WriteString(s string) *Chain
- func (b *Chain) WriteStringIf(cond bool, s string) *Chain
- func (b *Chain) WriteUint(u uint64) *Chain
- func (b *Chain) WriteUintIf(cond bool, u uint64) *Chain
- func (b *Chain) WriteX(x any) *Chain
- func (b *Chain) WriteXIf(cond bool, x any) *Chain
- type ChainBuf
- type MarshallerTo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccumulativeToBytes ¶ added in v1.0.5
AccumulativeToBytes registers x2bytes conversion function accepts Accumulative.
Types ¶
type AccBufWriter ¶ added in v1.0.4
type AccBufWriter = AccumulativeWriter
AccBufWriter is an alias of AccumulativeWriter type. DEPRECATED: use AccumulativeWriter instead. Kept for backward compatibility.
type Accumulative ¶ added in v1.0.5
type Accumulative struct {
// contains filtered or unexported fields
}
Accumulative is a wrapper around Chain that allows to accumulate buffer data and use only necessary part.
See StakeOut and Staked* methods.
func (*Accumulative) Bytes ¶ added in v1.0.5
func (b *Accumulative) Bytes() []byte
Bytes returns contents of the buffer.
func (*Accumulative) BytesCopy ¶ added in v1.0.5
func (b *Accumulative) BytesCopy() []byte
BytesCopy returns copy of buffer contents.
func (*Accumulative) Cap ¶ added in v1.0.5
func (b *Accumulative) Cap() int
func (*Accumulative) Error ¶ added in v1.0.5
func (b *Accumulative) Error() error
Get last error caught in Write* methods.
func (*Accumulative) Grow ¶ added in v1.0.5
func (b *Accumulative) Grow(newLen int) *Accumulative
Grow increases length of the buffer.
func (*Accumulative) GrowDelta ¶ added in v1.0.5
func (b *Accumulative) GrowDelta(delta int) *Accumulative
GrowDelta increases length of the buffer to actual length + delta.
See Grow().
func (*Accumulative) Len ¶ added in v1.0.5
func (b *Accumulative) Len() int
func (*Accumulative) RangeBytes ¶ added in v1.0.5
func (b *Accumulative) RangeBytes(off, len int) []byte
RangeBytes returns buffer bytes from offset off with length len.
func (*Accumulative) RangeBytesCopy ¶ added in v1.0.5
func (b *Accumulative) RangeBytesCopy(off, len int) []byte
RangeBytesCopy copies result of RangeBytes().
func (*Accumulative) RangeString ¶ added in v1.0.5
func (b *Accumulative) RangeString(off, len int) string
RangeString returns buffer bytes as string from offset off with length len.
func (*Accumulative) RangeStringCopy ¶ added in v1.0.5
func (b *Accumulative) RangeStringCopy(off, len int) string
RangeStringCopy copies result of RangeString().
func (*Accumulative) Replace ¶ added in v1.0.5
func (b *Accumulative) Replace(old, new []byte, n int) *Accumulative
Replace replaces old bytes to new in buffer.
func (*Accumulative) ReplaceAll ¶ added in v1.0.5
func (b *Accumulative) ReplaceAll(old, new []byte) *Accumulative
ReplaceAll replace all occurrences of old bytes to new in buffer.
func (*Accumulative) ReplaceStr ¶ added in v1.0.5
func (b *Accumulative) ReplaceStr(old, new string, n int) *Accumulative
ReplaceStr replace old to new substrings in buffer. DEPRECATED: use ReplaceString() instead.
func (*Accumulative) ReplaceStrAll ¶ added in v1.0.5
func (b *Accumulative) ReplaceStrAll(old, new string) *Accumulative
ReplaceStrAll replaces all occurrences of old substrings to new in buffer. DEPRECATED: use ReplaceStringAll() instead.
func (*Accumulative) ReplaceString ¶ added in v1.0.5
func (b *Accumulative) ReplaceString(old, new string, n int) *Accumulative
ReplaceString replace old to new substrings in buffer.
func (*Accumulative) ReplaceStringAll ¶ added in v1.0.5
func (b *Accumulative) ReplaceStringAll(old, new string) *Accumulative
ReplaceStringAll replaces all occurrences of old substrings to new in buffer.
func (*Accumulative) Reset ¶ added in v1.0.5
func (b *Accumulative) Reset() *Accumulative
func (*Accumulative) StakeOut ¶ added in v1.0.5
func (b *Accumulative) StakeOut() *Accumulative
StakeOut saves current offset for further use.
func (*Accumulative) StakedBytes ¶ added in v1.0.5
func (b *Accumulative) StakedBytes() []byte
StakedBytes returns accumulated bytes from staked offset.
func (*Accumulative) StakedBytesCopy ¶ added in v1.0.5
func (b *Accumulative) StakedBytesCopy() []byte
StakedBytesCopy returns copy of accumulated bytes since staked offset.
func (*Accumulative) StakedLen ¶ added in v1.0.5
func (b *Accumulative) StakedLen() int
StakedLen returns length of accumulated bytes since staked offset.
func (*Accumulative) StakedOffset ¶ added in v1.0.5
func (b *Accumulative) StakedOffset() int
StakedOffset returns staked offset.
func (*Accumulative) StakedString ¶ added in v1.0.5
func (b *Accumulative) StakedString() string
StakedString returns accumulated bytes as string.
func (*Accumulative) StakedStringCopy ¶ added in v1.0.5
func (b *Accumulative) StakedStringCopy() string
StakedStringCopy returns copy of accumulated bytes as string.
func (*Accumulative) String ¶ added in v1.0.5
func (b *Accumulative) String() string
Get contents of the buffer as string.
func (*Accumulative) StringCopy ¶ added in v1.0.5
func (b *Accumulative) StringCopy() string
StringCopy returns copy of the buffer contents as string.
func (*Accumulative) ToWriter ¶ added in v1.0.5
func (b *Accumulative) ToWriter() *AccumulativeWriter
ToWriter wraps buffer with class implementing IO interfaces.
func (*Accumulative) Write ¶ added in v1.0.5
func (b *Accumulative) Write(p []byte) *Accumulative
Write bytes to the buffer.
func (*Accumulative) WriteApplyFn ¶ added in v1.0.5
func (b *Accumulative) WriteApplyFn(p []byte, fn func(dst, p []byte) []byte) *Accumulative
WriteApplyFn applies fn to p and write result to the buffer.
func (*Accumulative) WriteApplyFnIf ¶ added in v1.0.6
func (b *Accumulative) WriteApplyFnIf(cond bool, p []byte, fn func(dst, p []byte) []byte) *Accumulative
func (*Accumulative) WriteApplyFnStr ¶ added in v1.0.5
func (b *Accumulative) WriteApplyFnStr(s string, fn func(dst, p []byte) []byte) *Accumulative
WriteApplyFnStr applies fn to s and write result to the buffer. DEPRECATED: use WriteApplyFnString() instead.
func (*Accumulative) WriteApplyFnString ¶ added in v1.0.5
func (b *Accumulative) WriteApplyFnString(s string, fn func(dst, p []byte) []byte) *Accumulative
WriteApplyFnString applies fn to s and write result to the buffer.
func (*Accumulative) WriteApplyFnStringIf ¶ added in v1.0.6
func (b *Accumulative) WriteApplyFnStringIf(cond bool, s string, fn func(dst, p []byte) []byte) *Accumulative
func (*Accumulative) WriteBool ¶ added in v1.0.5
func (b *Accumulative) WriteBool(v bool) *Accumulative
WriteBool writes boolean value to the buffer.
func (*Accumulative) WriteBoolIf ¶ added in v1.0.6
func (b *Accumulative) WriteBoolIf(cond bool, v bool) *Accumulative
func (*Accumulative) WriteByte ¶ added in v1.0.5
func (b *Accumulative) WriteByte(p byte) *Accumulative
WriteByte writes single byte.
func (*Accumulative) WriteByteIf ¶ added in v1.0.6
func (b *Accumulative) WriteByteIf(cond bool, p byte) *Accumulative
func (*Accumulative) WriteFloat ¶ added in v1.0.5
func (b *Accumulative) WriteFloat(f float64) *Accumulative
WriteFloat writes float value to the buffer.
func (*Accumulative) WriteFloatIf ¶ added in v1.0.6
func (b *Accumulative) WriteFloatIf(cond bool, f float64) *Accumulative
func (*Accumulative) WriteIf ¶ added in v1.0.6
func (b *Accumulative) WriteIf(cond bool, p []byte) *Accumulative
func (*Accumulative) WriteInt ¶ added in v1.0.5
func (b *Accumulative) WriteInt(i int64) *Accumulative
WriteInt writes integer value to the buffer.
func (*Accumulative) WriteIntIf ¶ added in v1.0.6
func (b *Accumulative) WriteIntIf(cond bool, i int64) *Accumulative
func (*Accumulative) WriteMarshallerTo ¶ added in v1.0.5
func (b *Accumulative) WriteMarshallerTo(m MarshallerTo) *Accumulative
WriteMarshallerTo marshal data of struct implemented MarshallerTo interface and write it to the buffer.
func (*Accumulative) WriteMarshallerToIf ¶ added in v1.0.6
func (b *Accumulative) WriteMarshallerToIf(cond bool, m MarshallerTo) *Accumulative
func (*Accumulative) WriteStr ¶ added in v1.0.5
func (b *Accumulative) WriteStr(s string) *Accumulative
WriteStr writes string to the buffer. DEPRECATED: use WriteString() instead.
func (*Accumulative) WriteString ¶ added in v1.0.5
func (b *Accumulative) WriteString(s string) *Accumulative
WriteString writes string to the buffer.
func (*Accumulative) WriteStringIf ¶ added in v1.0.6
func (b *Accumulative) WriteStringIf(cond bool, s string) *Accumulative
func (*Accumulative) WriteUint ¶ added in v1.0.5
func (b *Accumulative) WriteUint(u uint64) *Accumulative
WriteUint writes unsigned integer value to the buffer.
func (*Accumulative) WriteUintIf ¶ added in v1.0.6
func (b *Accumulative) WriteUintIf(cond bool, u uint64) *Accumulative
func (*Accumulative) WriteX ¶ added in v1.0.5
func (b *Accumulative) WriteX(x any) *Accumulative
WriteX write v with arbitrary type to the buffer.
func (*Accumulative) WriteXIf ¶ added in v1.0.6
func (b *Accumulative) WriteXIf(cond bool, x any) *Accumulative
type AccumulativeBuf ¶
type AccumulativeBuf = Accumulative
AccumulativeBuf is an alias of Accumulative type. DEPRECATED: use Accumulative instead. Kept for backward compatibility.
type AccumulativeWriter ¶ added in v1.0.5
type AccumulativeWriter struct {
// contains filtered or unexported fields
}
AccumulativeWriter is a wrapper around Accumulative that implements IO writers interfaces.
func (AccumulativeWriter) Bytes ¶ added in v1.0.6
func (b AccumulativeWriter) Bytes() []byte
func (AccumulativeWriter) Cap ¶ added in v1.0.6
func (b AccumulativeWriter) Cap() int
func (AccumulativeWriter) Len ¶ added in v1.0.6
func (b AccumulativeWriter) Len() int
func (AccumulativeWriter) Reset ¶ added in v1.0.6
func (b AccumulativeWriter) Reset()
func (AccumulativeWriter) String ¶ added in v1.0.6
func (b AccumulativeWriter) String() string
func (AccumulativeWriter) Write ¶ added in v1.0.5
func (b AccumulativeWriter) Write(p []byte) (int, error)
func (AccumulativeWriter) WriteApplyFn ¶ added in v1.0.6
func (AccumulativeWriter) WriteApplyFnString ¶ added in v1.0.6
func (AccumulativeWriter) WriteBool ¶ added in v1.0.6
func (b AccumulativeWriter) WriteBool(b_ bool) (int, error)
func (AccumulativeWriter) WriteByte ¶ added in v1.0.5
func (b AccumulativeWriter) WriteByte(p byte) error
func (AccumulativeWriter) WriteFloat ¶ added in v1.0.6
func (b AccumulativeWriter) WriteFloat(f float64) (int, error)
func (AccumulativeWriter) WriteInt ¶ added in v1.0.6
func (b AccumulativeWriter) WriteInt(i int64) (int, error)
func (AccumulativeWriter) WriteMarshallerTo ¶ added in v1.0.6
func (b AccumulativeWriter) WriteMarshallerTo(m MarshallerTo) (int, error)
func (AccumulativeWriter) WriteString ¶ added in v1.0.5
func (b AccumulativeWriter) WriteString(s string) (int, error)
type Chain ¶ added in v1.0.5
type Chain []byte
Chain is a primitive byte buffer with chain call support.
func (*Chain) GrowDelta ¶ added in v1.0.5
GrowDelta increases length of the buffer to actual length + delta.
See Grow().
func (*Chain) ReplaceAll ¶ added in v1.0.5
ReplaceAll replace all occurrences of old bytes to new in buffer.
func (*Chain) ReplaceStr ¶ added in v1.0.5
ReplaceStr replace old to new substrings in buffer. DEPRECATED: use ReplaceString() instead.
func (*Chain) ReplaceStrAll ¶ added in v1.0.5
ReplaceStrAll replaces all occurrences of old substrings to new in buffer. DEPRECATED: use ReplaceStringAll() instead.
func (*Chain) ReplaceString ¶ added in v1.0.5
ReplaceString replace old to new substrings in buffer.
func (*Chain) ReplaceStringAll ¶ added in v1.0.5
ReplaceStringAll replaces all occurrences of old substrings to new in buffer.
func (*Chain) StringCopy ¶ added in v1.0.5
StringCopy returns copy of the buffer contents as string.
func (*Chain) WriteApplyFn ¶ added in v1.0.5
WriteApplyFn applies fn to p and write result to the buffer.
func (*Chain) WriteApplyFnIf ¶ added in v1.0.6
func (*Chain) WriteApplyFnStr ¶ added in v1.0.5
WriteApplyFnStr applies fn to s and write result to the buffer. DEPRECATED: use WriteApplyFnString() instead.
func (*Chain) WriteApplyFnString ¶ added in v1.0.5
WriteApplyFnString applies fn to s and write result to the buffer.
func (*Chain) WriteApplyFnStringIf ¶ added in v1.0.6
func (*Chain) WriteFloat ¶ added in v1.0.5
WriteFloat writes float value to the buffer.
func (*Chain) WriteFloatIf ¶ added in v1.0.6
func (*Chain) WriteMarshallerTo ¶ added in v1.0.5
func (b *Chain) WriteMarshallerTo(m MarshallerTo) *Chain
WriteMarshallerTo marshal data of struct implemented MarshallerTo interface and write it to the buffer.
func (*Chain) WriteMarshallerToIf ¶ added in v1.0.6
func (b *Chain) WriteMarshallerToIf(cond bool, m MarshallerTo) *Chain
func (*Chain) WriteStr ¶ added in v1.0.5
WriteStr writes string to the buffer. DEPRECATED: use WriteString() instead.
func (*Chain) WriteString ¶ added in v1.0.5
WriteString writes string to the buffer.