...

Package spantypes

import "github.com/illuscio-dev/spantools-go/spantypes"
Overview
Index

Overview ▾

Custom types used by the encoding package.

Named types for encoding / decoding extensions.

type BinData

BinData is used to hold raw binary blob information for structs that need to support encoding to and from JSON / BSON. The json encoder will hexify this data for transport, while BSON will transform it to a BSON Binary primitive.

type BinData []byte

func (BinData) MarshalBSONValue

func (data BinData) MarshalBSONValue() (bsontype.Type, []byte, error)

Marshal bson value.

func (BinData) MarshalText

func (data BinData) MarshalText() ([]byte, error)

Marshal to text value for json and others that implement this interface.

func (*BinData) UnmarshalBSONValue

func (data *BinData) UnmarshalBSONValue(
    valueType bsontype.Type, incomingData []byte,
) error

Unmarshal bson value.

func (*BinData) UnmarshalText

func (data *BinData) UnmarshalText(incomingData []byte) error

UnMarshal from text value for json and others that implement this interface.