Documentation
¶
Index ¶
- func Release(x *BatchReplace)
- type BatchReplace
- func (r *BatchReplace) B2B(old []byte, new []byte) *BatchReplace
- func (r *BatchReplace) B2F(old []byte, new float64) *BatchReplace
- func (r *BatchReplace) B2FT(old []byte, new float64, fmt byte, prec, bitSize int) *BatchReplace
- func (r *BatchReplace) B2I(old []byte, new int64) *BatchReplace
- func (r *BatchReplace) B2IB(old []byte, new int64, base int) *BatchReplace
- func (r *BatchReplace) B2S(old []byte, new string) *BatchReplace
- func (r *BatchReplace) B2U(old []byte, new uint64) *BatchReplace
- func (r *BatchReplace) B2UB(old []byte, new uint64, base int) *BatchReplace
- func (r *BatchReplace) BytesToBytes(old []byte, new []byte) *BatchReplace
- func (r *BatchReplace) BytesToFloat(old []byte, new float64) *BatchReplace
- func (r *BatchReplace) BytesToFloatTunable(old []byte, new float64, fmt byte, prec, bitSize int) *BatchReplace
- func (r *BatchReplace) BytesToInt(old []byte, new int64) *BatchReplace
- func (r *BatchReplace) BytesToIntBase(old []byte, new int64, base int) *BatchReplace
- func (r *BatchReplace) BytesToStr(old []byte, new string) *BatchReplace
- func (r *BatchReplace) BytesToUint(old []byte, new uint64) *BatchReplace
- func (r *BatchReplace) BytesToUintBase(old []byte, new uint64, base int) *BatchReplace
- func (r *BatchReplace) Commit() []byte
- func (r *BatchReplace) CommitCopy() []byte
- func (r *BatchReplace) CommitCopyStr() string
- func (r *BatchReplace) CommitStr() string
- func (r *BatchReplace) Reset() *BatchReplace
- func (r *BatchReplace) S2B(old string, new []byte) *BatchReplace
- func (r *BatchReplace) S2F(old string, new float64) *BatchReplace
- func (r *BatchReplace) S2FT(old string, new float64, fmt byte, prec, bitSize int) *BatchReplace
- func (r *BatchReplace) S2I(old string, new int64) *BatchReplace
- func (r *BatchReplace) S2IB(old string, new int64, base int) *BatchReplace
- func (r *BatchReplace) S2S(old, new string) *BatchReplace
- func (r *BatchReplace) S2U(old string, new uint64) *BatchReplace
- func (r *BatchReplace) S2UB(old string, new uint64, base int) *BatchReplace
- func (r *BatchReplace) SetSource(src []byte) *BatchReplace
- func (r *BatchReplace) SetSourceString(src string) *BatchReplace
- func (r *BatchReplace) SetSrcBytes(src []byte) *BatchReplace
- func (r *BatchReplace) SetSrcStr(src string) *BatchReplace
- func (r *BatchReplace) StrToBytes(old string, new []byte) *BatchReplace
- func (r *BatchReplace) StrToFloat(old string, new float64) *BatchReplace
- func (r *BatchReplace) StrToFloatTunable(old string, new float64, fmt byte, prec, bitSize int) *BatchReplace
- func (r *BatchReplace) StrToInt(old string, new int64) *BatchReplace
- func (r *BatchReplace) StrToIntBase(old string, new int64, base int) *BatchReplace
- func (r *BatchReplace) StrToStr(old, new string) *BatchReplace
- func (r *BatchReplace) StrToUint(old string, new uint64) *BatchReplace
- func (r *BatchReplace) StrToUintBase(old string, new uint64, base int) *BatchReplace
- type Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BatchReplace ¶
type BatchReplace struct {
// contains filtered or unexported fields
}
BatchReplace is a tool to collect replacement pairs and apply them once..
func Acquire ¶
func Acquire() *BatchReplace
Acquire gets replacer from default pool.
Please note, this method doesn't provide source for replacer and you need to specify it manually by calling SetSource() method.
func AcquireWithBytesSrc ¶
func AcquireWithBytesSrc(src []byte) *BatchReplace
AcquireWithBytesSrc gets replacer from default pool and set byte array as a source. Deprecated: use AcquireWithSource() instead.
func AcquireWithSource ¶ added in v1.1.1
func AcquireWithSource[T byteseq.Byteseq](x T) *BatchReplace
AcquireWithSource gets replace from default pool and sets source for replacements.
func AcquireWithStrSrc ¶
func AcquireWithStrSrc(src string) *BatchReplace
AcquireWithStrSrc gets replacer from default pool and set string as a source. Deprecated: use AcquireWithSource() instead.
func NewBatchReplace ¶
func NewBatchReplace[T byteseq.Byteseq](x T) *BatchReplace
NewBatchReplace inits new replacer.
func (*BatchReplace) B2B ¶
func (r *BatchReplace) B2B(old []byte, new []byte) *BatchReplace
B2B is an alias of BytesToBytes.
func (*BatchReplace) B2F ¶
func (r *BatchReplace) B2F(old []byte, new float64) *BatchReplace
B2F is an alias of BytesToFloat.
func (*BatchReplace) B2FT ¶
func (r *BatchReplace) B2FT(old []byte, new float64, fmt byte, prec, bitSize int) *BatchReplace
B2FT is an alias of BytesToFloatTunable.
func (*BatchReplace) B2I ¶
func (r *BatchReplace) B2I(old []byte, new int64) *BatchReplace
B2I is an alias of BytesToInt.
func (*BatchReplace) B2IB ¶
func (r *BatchReplace) B2IB(old []byte, new int64, base int) *BatchReplace
B2IB is an alias of BytesToIntBase.
func (*BatchReplace) B2S ¶
func (r *BatchReplace) B2S(old []byte, new string) *BatchReplace
B2S is an alias of BytesToStr.
func (*BatchReplace) B2U ¶
func (r *BatchReplace) B2U(old []byte, new uint64) *BatchReplace
B2U is an alias of BytesToUint.
func (*BatchReplace) B2UB ¶
func (r *BatchReplace) B2UB(old []byte, new uint64, base int) *BatchReplace
B2UB is an alias of BytesToUintBase.
func (*BatchReplace) BytesToBytes ¶
func (r *BatchReplace) BytesToBytes(old []byte, new []byte) *BatchReplace
BytesToBytes registers new bytes to bytes replacement.
func (*BatchReplace) BytesToFloat ¶
func (r *BatchReplace) BytesToFloat(old []byte, new float64) *BatchReplace
BytesToFloat registers bytes to float replacement.
func (*BatchReplace) BytesToFloatTunable ¶
func (r *BatchReplace) BytesToFloatTunable(old []byte, new float64, fmt byte, prec, bitSize int) *BatchReplace
BytesToFloatTunable registers bytes to float replacement with params.
func (*BatchReplace) BytesToInt ¶
func (r *BatchReplace) BytesToInt(old []byte, new int64) *BatchReplace
BytesToInt registers bytes to int replacement.
func (*BatchReplace) BytesToIntBase ¶
func (r *BatchReplace) BytesToIntBase(old []byte, new int64, base int) *BatchReplace
BytesToIntBase registers bytes to int replacement with given base.
func (*BatchReplace) BytesToStr ¶
func (r *BatchReplace) BytesToStr(old []byte, new string) *BatchReplace
BytesToStr registers new bytes to bytes to string replacement.
func (*BatchReplace) BytesToUint ¶
func (r *BatchReplace) BytesToUint(old []byte, new uint64) *BatchReplace
BytesToUint registers bytes to uint replacement.
func (*BatchReplace) BytesToUintBase ¶
func (r *BatchReplace) BytesToUintBase(old []byte, new uint64, base int) *BatchReplace
BytesToUintBase registers bytes to uint replacement with given base.
func (*BatchReplace) Commit ¶
func (r *BatchReplace) Commit() []byte
Commit applies all registered replacement pairs.
func (*BatchReplace) CommitCopy ¶
func (r *BatchReplace) CommitCopy() []byte
CommitCopy perform the replaces and return copy of result.
Made to avoid data sharing. See Commit.
func (*BatchReplace) CommitCopyStr ¶
func (r *BatchReplace) CommitCopyStr() string
CommitCopyStr os a string version of CommitCopy().
func (*BatchReplace) CommitStr ¶
func (r *BatchReplace) CommitStr() string
CommitStr is a string version of Commit().
func (*BatchReplace) Reset ¶
func (r *BatchReplace) Reset() *BatchReplace
Reset clears the replacer with keeping of allocated space to reuse.
func (*BatchReplace) S2B ¶
func (r *BatchReplace) S2B(old string, new []byte) *BatchReplace
S2B is an alias of StrToBytes.
func (*BatchReplace) S2F ¶
func (r *BatchReplace) S2F(old string, new float64) *BatchReplace
S2F is an alias of StrToFloat.
func (*BatchReplace) S2FT ¶
func (r *BatchReplace) S2FT(old string, new float64, fmt byte, prec, bitSize int) *BatchReplace
S2FT is an alias of StrToFloatTunable.
func (*BatchReplace) S2I ¶
func (r *BatchReplace) S2I(old string, new int64) *BatchReplace
S2I is an alias of StrToInt.
func (*BatchReplace) S2IB ¶
func (r *BatchReplace) S2IB(old string, new int64, base int) *BatchReplace
S2IB is an alias of StrToIntBase.
func (*BatchReplace) S2S ¶
func (r *BatchReplace) S2S(old, new string) *BatchReplace
S2S is an alias of StrToStr.
func (*BatchReplace) S2U ¶
func (r *BatchReplace) S2U(old string, new uint64) *BatchReplace
S2U is an alias of StrToUint.
func (*BatchReplace) S2UB ¶
func (r *BatchReplace) S2UB(old string, new uint64, base int) *BatchReplace
S2UB is an alias of StrToUintBase.
func (*BatchReplace) SetSource ¶ added in v1.1.1
func (r *BatchReplace) SetSource(src []byte) *BatchReplace
SetSource set the source as bytes.
For use outside of pools.
func (*BatchReplace) SetSourceString ¶ added in v1.1.1
func (r *BatchReplace) SetSourceString(src string) *BatchReplace
SetSourceString set the source as string.
func (*BatchReplace) SetSrcBytes ¶
func (r *BatchReplace) SetSrcBytes(src []byte) *BatchReplace
SetSrcBytes set the source as bytes.
For use outside of pools. Deprecated: use SetSource() instead.
func (*BatchReplace) SetSrcStr ¶
func (r *BatchReplace) SetSrcStr(src string) *BatchReplace
SetSrcStr set the source as string. Deprecated: use SetSourceString() instead.
func (*BatchReplace) StrToBytes ¶
func (r *BatchReplace) StrToBytes(old string, new []byte) *BatchReplace
StrToBytes registers new bytes to string to bytes replacement.
func (*BatchReplace) StrToFloat ¶
func (r *BatchReplace) StrToFloat(old string, new float64) *BatchReplace
StrToFloat registers string to float replacement.
func (*BatchReplace) StrToFloatTunable ¶
func (r *BatchReplace) StrToFloatTunable(old string, new float64, fmt byte, prec, bitSize int) *BatchReplace
StrToFloatTunable registers string to float replacement with params.
func (*BatchReplace) StrToInt ¶
func (r *BatchReplace) StrToInt(old string, new int64) *BatchReplace
StrToInt segisters string to int replacement.
func (*BatchReplace) StrToIntBase ¶
func (r *BatchReplace) StrToIntBase(old string, new int64, base int) *BatchReplace
StrToIntBase registers string to int replacement with given base.
func (*BatchReplace) StrToStr ¶
func (r *BatchReplace) StrToStr(old, new string) *BatchReplace
StrToStr registers new string to string replacement.
func (*BatchReplace) StrToUint ¶
func (r *BatchReplace) StrToUint(old string, new uint64) *BatchReplace
StrToUint registers string to uint replacement.
func (*BatchReplace) StrToUintBase ¶
func (r *BatchReplace) StrToUintBase(old string, new uint64, base int) *BatchReplace
StrToUintBase registers string to uint replacement with given base.