Documentation
¶
Index ¶
- func AccumulativeToBytes(dst []byte, val any, _ ...any) ([]byte, error)
- func ChainToBytes(dst []byte, val any, _ ...any) ([]byte, error)
- func ReleaseAccumulative(buf *Accumulative)
- func ReleaseChain(buf *Chain)
- 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) Reduce(delta int) *Accumulative
- 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) StackedByteptr() (p byteptr.Byteptr)
- func (b *Accumulative) StackedEntry16() (e entry.Entry16)
- func (b *Accumulative) StackedEntry32() (e entry.Entry32)
- func (b *Accumulative) StackedEntry64() (e entry.Entry64)
- 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) WriteApplyFnN(p []byte, fn func(dst, p []byte) []byte, n int) *Accumulative
- func (b *Accumulative) WriteApplyFnNIf(cond bool, p []byte, fn func(dst, p []byte) []byte, n int) *Accumulative
- func (b *Accumulative) WriteApplyFnNString(s string, fn func(dst, p []byte) []byte, n int) *Accumulative
- func (b *Accumulative) WriteApplyFnNStringIf(cond bool, s string, fn func(dst, p []byte) []byte, n int) *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) WriteBinary(order binary.ByteOrder, x any) *Accumulative
- func (b *Accumulative) WriteBinaryIf(cond bool, order binary.ByteOrder, x any) *Accumulative
- func (b *Accumulative) WriteBinaryN(order binary.ByteOrder, x any, n int) *Accumulative
- func (b *Accumulative) WriteBool(v bool) *Accumulative
- func (b *Accumulative) WriteBoolIf(cond bool, v bool) *Accumulative
- func (b *Accumulative) WriteBoolN(v bool, n int) *Accumulative
- func (b *Accumulative) WriteByte(p byte) *Accumulative
- func (b *Accumulative) WriteByteIf(cond bool, p byte) *Accumulative
- func (b *Accumulative) WriteByteN(p byte, n int) *Accumulative
- func (b *Accumulative) WriteFloat(f float64) *Accumulative
- func (b *Accumulative) WriteFloatIf(cond bool, f float64) *Accumulative
- func (b *Accumulative) WriteFloatN(f float64, n int) *Accumulative
- func (b *Accumulative) WriteFormat(format string, args ...any) *Accumulative
- func (b *Accumulative) WriteIf(cond bool, p []byte) *Accumulative
- func (b *Accumulative) WriteInt(i int64) *Accumulative
- func (b *Accumulative) WriteIntBase(i int64, base int) *Accumulative
- func (b *Accumulative) WriteIntBaseN(i int64, base, n int) *Accumulative
- func (b *Accumulative) WriteIntIf(cond bool, i int64) *Accumulative
- func (b *Accumulative) WriteIntN(i int64, n int) *Accumulative
- func (b *Accumulative) WriteMarshallerTo(m MarshallerTo) *Accumulative
- func (b *Accumulative) WriteMarshallerToIf(cond bool, m MarshallerTo) *Accumulative
- func (b *Accumulative) WriteN(p []byte, n int) *Accumulative
- func (b *Accumulative) WriteRune(r rune) *Accumulative
- func (b *Accumulative) WriteSLEB128(v int64) *Accumulative
- func (b *Accumulative) WriteSLEB128If(cond bool, v int64) *Accumulative
- func (b *Accumulative) WriteSLEB128N(v int64, n int) *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) WriteStringN(s string, n int) *Accumulative
- func (b *Accumulative) WriteTime(format string, t time.Time) *Accumulative
- func (b *Accumulative) WriteTimeIf(cond bool, format string, t time.Time) *Accumulative
- func (b *Accumulative) WriteTimeN(format string, t time.Time, n int) *Accumulative
- func (b *Accumulative) WriteULEB128(v uint64) *Accumulative
- func (b *Accumulative) WriteULEB128If(cond bool, v uint64) *Accumulative
- func (b *Accumulative) WriteULEB128N(v uint64, n int) *Accumulative
- func (b *Accumulative) WriteUint(u uint64) *Accumulative
- func (b *Accumulative) WriteUintBase(u uint64, base int) *Accumulative
- func (b *Accumulative) WriteUintBaseN(u uint64, base, n int) *Accumulative
- func (b *Accumulative) WriteUintIf(cond bool, u uint64) *Accumulative
- func (b *Accumulative) WriteUintN(u uint64, n int) *Accumulative
- func (b *Accumulative) WriteX(x any) *Accumulative
- func (b *Accumulative) WriteXIf(cond bool, x any) *Accumulative
- func (b *Accumulative) WriteXN(x any, n int) *Accumulative
- type AccumulativeBuf
- type AccumulativeWriter
- func (w AccumulativeWriter) Bytes() []byte
- func (w AccumulativeWriter) Cap() int
- func (w AccumulativeWriter) Len() int
- func (w AccumulativeWriter) Reset()
- func (w AccumulativeWriter) String() string
- func (w AccumulativeWriter) Write(p []byte) (int, error)
- func (w AccumulativeWriter) WriteApplyFn(p []byte, fn func(dst, p []byte) []byte) (int, error)
- func (w AccumulativeWriter) WriteApplyFnN(p []byte, fn func(dst, p []byte) []byte, n int) (int, error)
- func (w AccumulativeWriter) WriteApplyFnNString(s string, fn func(dst, p []byte) []byte, n int) (int, error)
- func (w AccumulativeWriter) WriteApplyFnString(s string, fn func(dst, p []byte) []byte) (int, error)
- func (w AccumulativeWriter) WriteBinary(order binary.ByteOrder, x any) (int, error)
- func (w AccumulativeWriter) WriteBool(b bool) (int, error)
- func (w AccumulativeWriter) WriteByte(b byte) error
- func (w AccumulativeWriter) WriteFloat(f float64) (int, error)
- func (w AccumulativeWriter) WriteInt(i int64) (int, error)
- func (w AccumulativeWriter) WriteMarshallerTo(m MarshallerTo) (int, error)
- func (w AccumulativeWriter) WriteSLEB128(v int64) (int, error)
- func (w AccumulativeWriter) WriteString(s string) (int, error)
- func (w AccumulativeWriter) WriteTime(format string, t time.Time) (int, error)
- func (w AccumulativeWriter) WriteULEB128(v uint64) (int, error)
- func (w AccumulativeWriter) WriteUint(u uint64) (int, error)
- func (w 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) Reduce(delta int) *Chain
- 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) ToWriter() *ChainWriter
- 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) WriteApplyFnN(p []byte, fn func(dst, p []byte) []byte, n int) *Chain
- func (b *Chain) WriteApplyFnNIf(cond bool, p []byte, fn func(dst, p []byte) []byte, n int) *Chain
- func (b *Chain) WriteApplyFnNString(s string, fn func(dst, p []byte) []byte, n int) *Chain
- func (b *Chain) WriteApplyFnNStringIf(cond bool, s string, fn func(dst, p []byte) []byte, n int) *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) WriteBinary(order binary.ByteOrder, x any) *Chain
- func (b *Chain) WriteBinaryIf(cond bool, order binary.ByteOrder, x any) *Chain
- func (b *Chain) WriteBinaryN(order binary.ByteOrder, x any, n int) *Chain
- func (b *Chain) WriteBool(v bool) *Chain
- func (b *Chain) WriteBoolIf(cond bool, v bool) *Chain
- func (b *Chain) WriteBoolN(v bool, n int) *Chain
- func (b *Chain) WriteByte(p byte) *Chain
- func (b *Chain) WriteByteIf(cond bool, p byte) *Chain
- func (b *Chain) WriteByteN(p byte, n int) *Chain
- func (b *Chain) WriteFloat(f float64) *Chain
- func (b *Chain) WriteFloatIf(cond bool, f float64) *Chain
- func (b *Chain) WriteFloatN(f float64, n int) *Chain
- func (b *Chain) WriteFormat(format string, args ...any) *Chain
- func (b *Chain) WriteIf(cond bool, p []byte) *Chain
- func (b *Chain) WriteInt(i int64) *Chain
- func (b *Chain) WriteIntBase(i int64, base int) *Chain
- func (b *Chain) WriteIntBaseIf(cond bool, i int64, base int) *Chain
- func (b *Chain) WriteIntBaseN(i int64, base, n int) *Chain
- func (b *Chain) WriteIntIf(cond bool, i int64) *Chain
- func (b *Chain) WriteIntN(i int64, n int) *Chain
- func (b *Chain) WriteMarshallerTo(m MarshallerTo) *Chain
- func (b *Chain) WriteMarshallerToIf(cond bool, m MarshallerTo) *Chain
- func (b *Chain) WriteN(p []byte, n int) *Chain
- func (b *Chain) WriteRune(r rune) *Chain
- func (b *Chain) WriteSLEB128(v int64) *Chain
- func (b *Chain) WriteSLEB128If(cond bool, v int64) *Chain
- func (b *Chain) WriteSLEB128N(v int64, n int) *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) WriteStringN(s string, n int) *Chain
- func (b *Chain) WriteTime(format string, t time.Time) *Chain
- func (b *Chain) WriteTimeIf(cond bool, format string, t time.Time) *Chain
- func (b *Chain) WriteTimeN(format string, t time.Time, n int) *Chain
- func (b *Chain) WriteULEB128(v uint64) *Chain
- func (b *Chain) WriteULEB128If(cond bool, v uint64) *Chain
- func (b *Chain) WriteULEB128N(v uint64, n int) *Chain
- func (b *Chain) WriteUint(u uint64) *Chain
- func (b *Chain) WriteUintBase(u uint64, base int) *Chain
- func (b *Chain) WriteUintBaseIf(cond bool, u uint64, base int) *Chain
- func (b *Chain) WriteUintBaseN(u uint64, base, n int) *Chain
- func (b *Chain) WriteUintIf(cond bool, u uint64) *Chain
- func (b *Chain) WriteUintN(u uint64, n int) *Chain
- func (b *Chain) WriteX(x any) *Chain
- func (b *Chain) WriteXIf(cond bool, x any) *Chain
- func (b *Chain) WriteXN(x any, n int) *Chain
- type ChainBuf
- type ChainWriter
- func (w ChainWriter) Bytes() []byte
- func (w ChainWriter) Cap() int
- func (w ChainWriter) Len() int
- func (w ChainWriter) Reset()
- func (w ChainWriter) String() string
- func (w ChainWriter) Write(p []byte) (int, error)
- func (w ChainWriter) WriteApplyFn(p []byte, fn func(dst, p []byte) []byte) (int, error)
- func (w ChainWriter) WriteApplyFnN(p []byte, fn func(dst, p []byte) []byte, n int) (int, error)
- func (w ChainWriter) WriteApplyFnNString(s string, fn func(dst, p []byte) []byte, n int) (int, error)
- func (w ChainWriter) WriteApplyFnString(s string, fn func(dst, p []byte) []byte) (int, error)
- func (w ChainWriter) WriteBinary(order binary.ByteOrder, x any) (int, error)
- func (w ChainWriter) WriteBool(b bool) (int, error)
- func (w ChainWriter) WriteByte(b byte) error
- func (w ChainWriter) WriteFloat(f float64) (int, error)
- func (w ChainWriter) WriteInt(i int64) (int, error)
- func (w ChainWriter) WriteMarshallerTo(m MarshallerTo) (int, error)
- func (w ChainWriter) WriteSLEB128(v int64) (int, error)
- func (w ChainWriter) WriteString(s string) (int, error)
- func (w ChainWriter) WriteTime(format string, t time.Time) (int, error)
- func (w ChainWriter) WriteULEB128(v uint64) (int, error)
- func (w ChainWriter) WriteUint(u uint64) (int, error)
- func (w ChainWriter) WriteX(x any) (int, error)
- 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.
func ChainToBytes ¶ added in v1.0.5
ChainToBytes registers x2bytes conversion function accepts Chain.
func ReleaseAccumulative ¶ added in v1.0.7
func ReleaseAccumulative(buf *Accumulative)
ReleaseAccumulative puts Accumulative buffer instance to the pool.
func ReleaseChain ¶ added in v1.0.7
func ReleaseChain(buf *Chain)
ReleaseChain puts Chain buffer instance to the pool.
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 AcquireAccumulative ¶ added in v1.0.7
func AcquireAccumulative() *Accumulative
AcquireAccumulative gets Accumulative buffer instance from the pool.
func NewAccumulative ¶ added in v1.0.7
func NewAccumulative(buf []byte) *Accumulative
NewAccumulative creates and initializes a new accumulative buffer instance using buf as its initial contents.
func NewAccumulativeSize ¶ added in v1.0.7
func NewAccumulativeSize(size int) *Accumulative
NewAccumulativeSize creates new accumulative buffer and initializes byte slice as an internal buffer.
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) Reduce ¶ added in v1.0.7
func (b *Accumulative) Reduce(delta int) *Accumulative
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) StackedByteptr ¶ added in v1.1.0
func (b *Accumulative) StackedByteptr() (p byteptr.Byteptr)
StackedByteptr returns byteptr wrapper for stacked bytes.
func (*Accumulative) StackedEntry16 ¶ added in v1.1.0
func (b *Accumulative) StackedEntry16() (e entry.Entry16)
StackedEntry16 returns Entry16 encoded lo/hi offsets of stacked bytes.
func (*Accumulative) StackedEntry32 ¶ added in v1.1.0
func (b *Accumulative) StackedEntry32() (e entry.Entry32)
StackedEntry32 returns Entry32 encoded lo/hi offsets of stacked bytes.
func (*Accumulative) StackedEntry64 ¶ added in v1.1.0
func (b *Accumulative) StackedEntry64() (e entry.Entry64)
StackedEntry64 returns Entry64 encoded lo/hi offsets of stacked bytes.
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) WriteApplyFnN ¶ added in v1.0.8
func (b *Accumulative) WriteApplyFnN(p []byte, fn func(dst, p []byte) []byte, n int) *Accumulative
WriteApplyFnN applies fn to p N times and write result to the buffer.
func (*Accumulative) WriteApplyFnNIf ¶ added in v1.0.8
func (b *Accumulative) WriteApplyFnNIf(cond bool, p []byte, fn func(dst, p []byte) []byte, n int) *Accumulative
func (*Accumulative) WriteApplyFnNString ¶ added in v1.0.8
func (b *Accumulative) WriteApplyFnNString(s string, fn func(dst, p []byte) []byte, n int) *Accumulative
WriteApplyFnNString applies fn to s and write result to the buffer.
func (*Accumulative) WriteApplyFnNStringIf ¶ added in v1.0.8
func (b *Accumulative) WriteApplyFnNStringIf(cond bool, s string, fn func(dst, p []byte) []byte, n int) *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) WriteBinary ¶ added in v1.1.2
func (b *Accumulative) WriteBinary(order binary.ByteOrder, x any) *Accumulative
WriteBinary writes binary representation of x with arbitrary type to the buffer in given byte order.
func (*Accumulative) WriteBinaryIf ¶ added in v1.1.2
func (b *Accumulative) WriteBinaryIf(cond bool, order binary.ByteOrder, x any) *Accumulative
func (*Accumulative) WriteBinaryN ¶ added in v1.1.2
func (b *Accumulative) WriteBinaryN(order binary.ByteOrder, x any, n int) *Accumulative
WriteBinaryN writes binary representation of x to buffer N times. See WriteBinary.
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) WriteBoolN ¶ added in v1.0.9
func (b *Accumulative) WriteBoolN(v bool, n int) *Accumulative
WriteBoolN writes v to buffer N times. See WriteBool.
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) WriteByteN ¶ added in v1.0.9
func (b *Accumulative) WriteByteN(p byte, n int) *Accumulative
WriteByteN writes p to buffer N times. See WriteByte.
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) WriteFloatN ¶ added in v1.0.9
func (b *Accumulative) WriteFloatN(f float64, n int) *Accumulative
WriteFloatN writes f to buffer N times. See WriteFloat.
func (*Accumulative) WriteFormat ¶ added in v1.1.0
func (b *Accumulative) WriteFormat(format string, args ...any) *Accumulative
WriteFormat writes formatted string to the buffer.
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) WriteIntBase ¶ added in v1.0.7
func (b *Accumulative) WriteIntBase(i int64, base int) *Accumulative
WriteIntBase writes integer value in given base to the buffer.
func (*Accumulative) WriteIntBaseN ¶ added in v1.0.9
func (b *Accumulative) WriteIntBaseN(i int64, base, n int) *Accumulative
WriteIntBaseN writes i to buffer N times. See WriteIntBase.
func (*Accumulative) WriteIntIf ¶ added in v1.0.6
func (b *Accumulative) WriteIntIf(cond bool, i int64) *Accumulative
func (*Accumulative) WriteIntN ¶ added in v1.0.9
func (b *Accumulative) WriteIntN(i int64, n int) *Accumulative
WriteIntN writes i to buffer N times. See WriteInt.
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) WriteN ¶ added in v1.0.9
func (b *Accumulative) WriteN(p []byte, n int) *Accumulative
WriteN writes p to buffer N times. See Write.
func (*Accumulative) WriteRune ¶ added in v1.1.0
func (b *Accumulative) WriteRune(r rune) *Accumulative
WriteRune writes rune to the buffer.
func (*Accumulative) WriteSLEB128 ¶ added in v1.1.2
func (b *Accumulative) WriteSLEB128(v int64) *Accumulative
WriteSLEB128 writes signed LEB128 representation of int64 value to the buffer.
func (*Accumulative) WriteSLEB128If ¶ added in v1.1.2
func (b *Accumulative) WriteSLEB128If(cond bool, v int64) *Accumulative
func (*Accumulative) WriteSLEB128N ¶ added in v1.1.2
func (b *Accumulative) WriteSLEB128N(v int64, n int) *Accumulative
WriteSLEB128N writes signed LEB128 representation of uint64 value to buffer N times. See WriteSLEB128.
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) WriteStringN ¶ added in v1.0.9
func (b *Accumulative) WriteStringN(s string, n int) *Accumulative
WriteStringN writes s to buffer N times. See WriteString.
func (*Accumulative) WriteTime ¶ added in v1.0.7
func (b *Accumulative) WriteTime(format string, t time.Time) *Accumulative
WriteTime writes time t in given format to the buffer.
func (*Accumulative) WriteTimeIf ¶ added in v1.0.7
func (b *Accumulative) WriteTimeIf(cond bool, format string, t time.Time) *Accumulative
func (*Accumulative) WriteTimeN ¶ added in v1.1.2
func (b *Accumulative) WriteTimeN(format string, t time.Time, n int) *Accumulative
WriteTimeN writes time in given format to buffer N times. See WriteTime.
func (*Accumulative) WriteULEB128 ¶ added in v1.1.2
func (b *Accumulative) WriteULEB128(v uint64) *Accumulative
WriteULEB128 writes unsigned LEB128 representation of uint64 value to the buffer.
func (*Accumulative) WriteULEB128If ¶ added in v1.1.2
func (b *Accumulative) WriteULEB128If(cond bool, v uint64) *Accumulative
func (*Accumulative) WriteULEB128N ¶ added in v1.1.2
func (b *Accumulative) WriteULEB128N(v uint64, n int) *Accumulative
WriteULEB128N writes unsigned LEB128 representation of uint64 value to buffer N times. See WriteULEB128.
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) WriteUintBase ¶ added in v1.0.7
func (b *Accumulative) WriteUintBase(u uint64, base int) *Accumulative
WriteUintBase writes unsigned integer value in given base to the buffer.
func (*Accumulative) WriteUintBaseN ¶ added in v1.0.9
func (b *Accumulative) WriteUintBaseN(u uint64, base, n int) *Accumulative
WriteUintBaseN writes u to buffer N times. See WriteUintBase.
func (*Accumulative) WriteUintIf ¶ added in v1.0.6
func (b *Accumulative) WriteUintIf(cond bool, u uint64) *Accumulative
func (*Accumulative) WriteUintN ¶ added in v1.0.9
func (b *Accumulative) WriteUintN(u uint64, n int) *Accumulative
WriteUintN writes u to buffer N times. See WriteUint.
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
func (*Accumulative) WriteXN ¶ added in v1.0.9
func (b *Accumulative) WriteXN(x any, n int) *Accumulative
WriteXN writes x to buffer N times. See WriteX.
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 (w AccumulativeWriter) Bytes() []byte
func (AccumulativeWriter) Cap ¶ added in v1.0.6
func (w AccumulativeWriter) Cap() int
func (AccumulativeWriter) Len ¶ added in v1.0.6
func (w AccumulativeWriter) Len() int
func (AccumulativeWriter) Reset ¶ added in v1.0.6
func (w AccumulativeWriter) Reset()
func (AccumulativeWriter) String ¶ added in v1.0.6
func (w AccumulativeWriter) String() string
func (AccumulativeWriter) Write ¶ added in v1.0.5
func (w AccumulativeWriter) Write(p []byte) (int, error)
func (AccumulativeWriter) WriteApplyFn ¶ added in v1.0.6
func (AccumulativeWriter) WriteApplyFnN ¶ added in v1.0.8
func (AccumulativeWriter) WriteApplyFnNString ¶ added in v1.0.8
func (AccumulativeWriter) WriteApplyFnString ¶ added in v1.0.6
func (AccumulativeWriter) WriteBinary ¶ added in v1.1.2
func (AccumulativeWriter) WriteBool ¶ added in v1.0.6
func (w AccumulativeWriter) WriteBool(b bool) (int, error)
func (AccumulativeWriter) WriteByte ¶ added in v1.0.5
func (w AccumulativeWriter) WriteByte(b byte) error
func (AccumulativeWriter) WriteFloat ¶ added in v1.0.6
func (w AccumulativeWriter) WriteFloat(f float64) (int, error)
func (AccumulativeWriter) WriteInt ¶ added in v1.0.6
func (w AccumulativeWriter) WriteInt(i int64) (int, error)
func (AccumulativeWriter) WriteMarshallerTo ¶ added in v1.0.6
func (w AccumulativeWriter) WriteMarshallerTo(m MarshallerTo) (int, error)
func (AccumulativeWriter) WriteSLEB128 ¶ added in v1.1.2
func (w AccumulativeWriter) WriteSLEB128(v int64) (int, error)
func (AccumulativeWriter) WriteString ¶ added in v1.0.5
func (w AccumulativeWriter) WriteString(s string) (int, error)
func (AccumulativeWriter) WriteULEB128 ¶ added in v1.1.2
func (w AccumulativeWriter) WriteULEB128(v uint64) (int, error)
type Chain ¶ added in v1.0.5
type Chain []byte
Chain is a primitive byte buffer with chain call support.
func AcquireChain ¶ added in v1.0.7
func AcquireChain() *Chain
AcquireChain gets Chain buffer instance from the pool.
func NewChain ¶ added in v1.0.7
NewChain creates and initializes a new chain buffer instance using buf as its initial contents.
func NewChainSize ¶ added in v1.0.7
NewChainSize creates new chain buffer and initializes byte slice as an internal buffer.
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) ToWriter ¶ added in v1.1.2
func (b *Chain) ToWriter() *ChainWriter
ToWriter wraps buffer with class implementing IO interfaces.
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) WriteApplyFnN ¶ added in v1.0.8
WriteApplyFnN applies fn to p N times and write result to the buffer.
func (*Chain) WriteApplyFnNIf ¶ added in v1.0.8
func (*Chain) WriteApplyFnNString ¶ added in v1.0.8
WriteApplyFnNString applies fn to s N times and write result to the buffer.
func (*Chain) WriteApplyFnNStringIf ¶ added in v1.0.8
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) WriteBinary ¶ added in v1.1.2
WriteBinary writes binary representation of x with arbitrary type to the buffer in given byte order.
func (*Chain) WriteBinaryIf ¶ added in v1.1.2
func (*Chain) WriteBinaryN ¶ added in v1.1.2
WriteBinaryN writes x to buffer N times. See WriteBinary.
func (*Chain) WriteBoolN ¶ added in v1.0.9
WriteBoolN writes v to buffer N times. See WriteBool.
func (*Chain) WriteByteN ¶ added in v1.0.9
WriteByteN writes p to buffer N times. See WriteByte.
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) WriteFloatN ¶ added in v1.0.9
WriteFloatN writes f to buffer N times. See WriteFloat.
func (*Chain) WriteFormat ¶ added in v1.1.0
WriteFormat writes formatted string to the buffer.
func (*Chain) WriteIntBase ¶ added in v1.0.7
WriteIntBase writes integer value in given base to the buffer.
func (*Chain) WriteIntBaseIf ¶ added in v1.0.7
func (*Chain) WriteIntBaseN ¶ added in v1.0.9
WriteIntBaseN writes i to buffer N times. See WriteIntBase.
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) WriteSLEB128 ¶ added in v1.1.2
WriteSLEB128 writes signed LEB128 representation of int64 value.
func (*Chain) WriteSLEB128If ¶ added in v1.1.2
func (*Chain) WriteSLEB128N ¶ added in v1.1.2
WriteSLEB128N writes signed LEB128 representation of uint64 value to buffer N times. See WriteSLEB128.
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.
func (*Chain) WriteStringIf ¶ added in v1.0.6
func (*Chain) WriteStringN ¶ added in v1.0.9
WriteStringN writes s to buffer N times. See WriteString.
func (*Chain) WriteTimeIf ¶ added in v1.0.7
func (*Chain) WriteTimeN ¶ added in v1.1.2
WriteTimeN writes time in given format to buffer N times. See WriteTime.
func (*Chain) WriteULEB128 ¶ added in v1.1.2
WriteULEB128 writes unsigned LEB128 representation of uint64 value.
func (*Chain) WriteULEB128If ¶ added in v1.1.2
func (*Chain) WriteULEB128N ¶ added in v1.1.2
WriteULEB128N writes unsigned LEB128 representation of uint64 value to buffer N times. See WriteULEB128.
func (*Chain) WriteUintBase ¶ added in v1.0.7
WriteUintBase writes unsigned integer value in given base to the buffer.
func (*Chain) WriteUintBaseIf ¶ added in v1.0.7
func (*Chain) WriteUintBaseN ¶ added in v1.0.9
WriteUintBaseN writes u to buffer N times. See WriteUintBase.
func (*Chain) WriteUintN ¶ added in v1.0.9
WriteUintN writes u to buffer N times. See WriteUint.
type ChainBuf ¶
type ChainBuf = Chain
ChainBuf is an alias of Chain type. DEPRECATED: use Chain instead. Kept for backward compatibility.
type ChainWriter ¶ added in v1.1.2
type ChainWriter struct {
// contains filtered or unexported fields
}
ChainWriter is a wrapper around Chain that implements IO writers interfaces.
func (ChainWriter) Bytes ¶ added in v1.1.2
func (w ChainWriter) Bytes() []byte
func (ChainWriter) Cap ¶ added in v1.1.2
func (w ChainWriter) Cap() int
func (ChainWriter) Len ¶ added in v1.1.2
func (w ChainWriter) Len() int
func (ChainWriter) Reset ¶ added in v1.1.2
func (w ChainWriter) Reset()
func (ChainWriter) String ¶ added in v1.1.2
func (w ChainWriter) String() string
func (ChainWriter) WriteApplyFn ¶ added in v1.1.2
func (ChainWriter) WriteApplyFnN ¶ added in v1.1.2
func (ChainWriter) WriteApplyFnNString ¶ added in v1.1.2
func (ChainWriter) WriteApplyFnString ¶ added in v1.1.2
func (ChainWriter) WriteBinary ¶ added in v1.1.2
func (ChainWriter) WriteByte ¶ added in v1.1.2
func (w ChainWriter) WriteByte(b byte) error
func (ChainWriter) WriteFloat ¶ added in v1.1.2
func (w ChainWriter) WriteFloat(f float64) (int, error)
func (ChainWriter) WriteMarshallerTo ¶ added in v1.1.2
func (w ChainWriter) WriteMarshallerTo(m MarshallerTo) (int, error)
func (ChainWriter) WriteSLEB128 ¶ added in v1.1.2
func (w ChainWriter) WriteSLEB128(v int64) (int, error)
func (ChainWriter) WriteString ¶ added in v1.1.2
func (w ChainWriter) WriteString(s string) (int, error)
func (ChainWriter) WriteULEB128 ¶ added in v1.1.2
func (w ChainWriter) WriteULEB128(v uint64) (int, error)