Documentation
¶
Overview ¶
Package bytes contains generated code by adptool.
Package bytes provides a rich set of functions for the manipulation of byte slices.
This package is a generated adapter and mirrors the public API of the standard Go library's `bytes` package. It offers a convenient way to access the rich set of standard byte slice utilities within the generic context of this library.
For detailed information on the behavior of specific functions, please refer to the official Go documentation for the `bytes` package.
Index ¶
- Constants
- Variables
- func Clone(b []byte) []byte
- func Compare(a, b []byte) int
- func Contains(b, subslice []byte) bool
- func ContainsAny(b []byte, chars string) bool
- func ContainsFunc(b []byte, f func(rune) bool) bool
- func ContainsRune(b []byte, r rune) bool
- func Count(s, sep []byte) int
- func Cut(s, sep []byte) (before, after []byte, found bool)
- func CutPrefix(s, prefix []byte) (after []byte, found bool)
- func CutSuffix(s, suffix []byte) (before []byte, found bool)
- func Equal(a, b []byte) bool
- func EqualFold(s, t []byte) bool
- func Fields(s []byte) [][]byte
- func FieldsFunc(s []byte, f func(rune) bool) [][]byte
- func FieldsFuncSeq(s []byte, f func(rune) bool) iter.Seq[[]byte]
- func FieldsSeq(s []byte) iter.Seq[[]byte]
- func HasPrefix(s, prefix []byte) bool
- func HasSuffix(s, suffix []byte) bool
- func Index(s, sep []byte) int
- func IndexAny(s []byte, chars string) int
- func IndexByte(b []byte, c byte) int
- func IndexFunc(s []byte, f func(r rune) bool) int
- func IndexRune(s []byte, r rune) int
- func Join(s [][]byte, sep []byte) []byte
- func LastIndex(s, sep []byte) int
- func LastIndexAny(s []byte, chars string) int
- func LastIndexByte(s []byte, c byte) int
- func LastIndexFunc(s []byte, f func(r rune) bool) int
- func Lines(s []byte) iter.Seq[[]byte]
- func Map(mapping func(r rune) rune, s []byte) []byte
- func NewBuffer(buf []byte) *bytes.Buffer
- func NewBufferString(s string) *bytes.Buffer
- func NewReader(b []byte) *bytes.Reader
- func Repeat(b []byte, count int) []byte
- func Replace(s, old, new []byte, n int) []byte
- func ReplaceAll(s, old, new []byte) []byte
- func Runes(s []byte) []rune
- func Split(s, sep []byte) [][]byte
- func SplitAfter(s, sep []byte) [][]byte
- func SplitAfterN(s, sep []byte, n int) [][]byte
- func SplitAfterSeq(s, sep []byte) iter.Seq[[]byte]
- func SplitN(s, sep []byte, n int) [][]byte
- func SplitSeq(s, sep []byte) iter.Seq[[]byte]
- func Title(s []byte) []byte
- func ToLower(s []byte) []byte
- func ToLowerSpecial(c unicode.SpecialCase, s []byte) []byte
- func ToTitle(s []byte) []byte
- func ToTitleSpecial(c unicode.SpecialCase, s []byte) []byte
- func ToUpper(s []byte) []byte
- func ToUpperSpecial(c unicode.SpecialCase, s []byte) []byte
- func ToValidUTF8(s, replacement []byte) []byte
- func Trim(s []byte, cutset string) []byte
- func TrimFunc(s []byte, f func(r rune) bool) []byte
- func TrimLeft(s []byte, cutset string) []byte
- func TrimLeftFunc(s []byte, f func(r rune) bool) []byte
- func TrimPrefix(s, prefix []byte) []byte
- func TrimRight(s []byte, cutset string) []byte
- func TrimRightFunc(s []byte, f func(r rune) bool) []byte
- func TrimSpace(s []byte) []byte
- func TrimSuffix(s, suffix []byte) []byte
- type Buffer
- type Bytes
- func (b Bytes) Clone() Bytes
- func (b Bytes) Contains(sub []byte) bool
- func (b Bytes) FindString(s string) int
- func (b Bytes) HasPrefix(prefix []byte) bool
- func (b Bytes) HasSuffix(suffix []byte) bool
- func (b Bytes) Index(sub []byte) int
- func (b Bytes) Read(offset int, limit int) []byte
- func (b Bytes) ReadString(offset int, limit int) string
- func (b Bytes) Replace(old, replacement []byte, n int) []byte
- func (b Bytes) String() string
- func (b Bytes) Trim(cutset string) []byte
- func (b Bytes) TrimPrefix(prefix []byte) []byte
- func (b Bytes) TrimSpace() []byte
- func (b Bytes) TrimSuffix(suffix []byte) []byte
- type Reader
Constants ¶
const MinRead = bytes.MinRead
Variables ¶
var ErrTooLarge = bytes.ErrTooLarge
Functions ¶
func ContainsAny ¶
func ContainsRune ¶
func FieldsFuncSeq ¶ added in v0.6.0
func LastIndexAny ¶
func LastIndexByte ¶
func NewBufferString ¶
func ReplaceAll ¶
func SplitAfter ¶
func SplitAfterN ¶
func ToLowerSpecial ¶
func ToLowerSpecial(c unicode.SpecialCase, s []byte) []byte
func ToTitleSpecial ¶
func ToTitleSpecial(c unicode.SpecialCase, s []byte) []byte
func ToUpperSpecial ¶
func ToUpperSpecial(c unicode.SpecialCase, s []byte) []byte
func ToValidUTF8 ¶
func TrimPrefix ¶
func TrimSuffix ¶
Types ¶
type Bytes ¶
type Bytes []byte
Bytes is a type alias for []byte to provide methods.
func (Bytes) FindString ¶
FindString returns the index of the first instance of s in b, or -1 if s is not present in b.
func (Bytes) Index ¶
Index returns the index of the first instance of sub in b, or -1 if sub is not present in b.
func (Bytes) ReadString ¶
ReadString returns a string of the Bytes s beginning at offset and length limit.
func (Bytes) Replace ¶
Replace returns a copy of the slice with the first n non-overlapping instances of old replaced by replacement.
func (Bytes) Trim ¶
Trim returns a slice of the bytes, with all leading and trailing bytes contained in cutset removed.
func (Bytes) TrimPrefix ¶
TrimPrefix returns b without the provided leading prefix.
func (Bytes) TrimSpace ¶
TrimSpace returns a slice of the bytes, with all leading and trailing white space removed.
func (Bytes) TrimSuffix ¶
TrimSuffix returns b without the provided trailing suffix.