Help us shape the future of Go! Take the 2026 Go Developer Survey

byteslice

package
v0.57.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteSliceToRef

func ByteSliceToRef(ctx context.Context, bcs *block.Cursor, apply bool) (*block.BlockRef, error)

ByteSliceToRef converts a byte slice cursor into a block.BlockRef. If the cursor or byte slice is empty & apply is set, sets a empty ref. If apply is set, updates the block cursor to hold a BlockRef object.

func NewByteSliceBlock

func NewByteSliceBlock() block.Block

NewByteSliceBlock constructs a new byte slice block.

Types

type ByteSlice

type ByteSlice struct {
	// contains filtered or unexported fields
}

ByteSlice is a byte slice sub-block.

func NewByteSlice

func NewByteSlice(sl *[]byte) *ByteSlice

NewByteSlice constructs a new sub-block from a byte slice.

If sl is nil, returns nil.

func (*ByteSlice) BlockAliasIdentity added in v0.52.0

func (b *ByteSlice) BlockAliasIdentity() *block.AliasIdentityToken

BlockAliasIdentity returns the in-memory alias token for ByteSlice.

func (*ByteSlice) CloneBlock added in v0.52.0

func (b *ByteSlice) CloneBlock() (block.Block, error)

CloneBlock clones the byte slice block without sharing the backing slice.

func (*ByteSlice) GetBytes

func (b *ByteSlice) GetBytes() []byte

GetBytes returns the byte slice.

func (*ByteSlice) IsNil

func (b *ByteSlice) IsNil() bool

IsNil returns if the object is nil.

func (*ByteSlice) MarshalBlock

func (b *ByteSlice) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ByteSlice) UnmarshalBlock

func (b *ByteSlice) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL