triple_hyphen_io

package
v0.0.0-...-791c77c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Boundary = "---"
)

Variables

View Source
var BoundaryStringValue catgut.String

Functions

func ReadBoundary

func ReadBoundary(r *catgut.RingBuffer) (n int, err error)

Types

type Coder

type Coder[O any] struct {
	RequireMetadata bool
	Metadata, Blob  interfaces.Coder[O]
}

func (*Coder[O]) DecodeFrom

func (mr *Coder[O]) DecodeFrom(object O, r io.Reader) (n int64, err error)

func (Coder[O]) EncodeTo

func (coder Coder[O]) EncodeTo(
	object O,
	writer io.Writer,
) (n int64, err error)

type CoderTypeMap

type CoderTypeMap[S any] map[string]interfaces.Coder[*TypedStruct[S]]

func (CoderTypeMap[S]) DecodeFrom

func (c CoderTypeMap[S]) DecodeFrom(
	subject *TypedStruct[S],
	reader io.Reader,
) (n int64, err error)

func (CoderTypeMap[S]) EncodeTo

func (c CoderTypeMap[S]) EncodeTo(
	subject *TypedStruct[S],
	writer io.Writer,
) (n int64, err error)

type CoderTypeMapWithoutType

type CoderTypeMapWithoutType[S any] map[string]interfaces.Coder[S]

func (CoderTypeMapWithoutType[S]) DecodeFrom

func (c CoderTypeMapWithoutType[S]) DecodeFrom(
	subject *TypedStruct[S],
	reader io.Reader,
) (n int64, err error)

func (CoderTypeMapWithoutType[S]) EncodeTo

func (c CoderTypeMapWithoutType[S]) EncodeTo(
	subject *TypedStruct[S],
	writer io.Writer,
) (n int64, err error)

type Decoder

type Decoder[O any] struct {
	RequireMetadata bool
	Metadata, Blob  interfaces.DecoderFrom[O]
}

func (*Decoder[O]) DecodeFrom

func (mr *Decoder[O]) DecodeFrom(object O, r io.Reader) (n int64, err error)

type DecoderTypeMapWithoutType

type DecoderTypeMapWithoutType[S any] map[string]interfaces.DecoderFrom[S]

func (DecoderTypeMapWithoutType[S]) DecodeFrom

func (c DecoderTypeMapWithoutType[S]) DecodeFrom(
	subject *TypedStruct[S],
	reader io.Reader,
) (n int64, err error)

type MetadataWriterTo

type MetadataWriterTo interface {
	io.WriterTo
	HasMetadataContent() bool
}

type Reader

type Reader struct {
	RequireMetadata bool // TODO-P4 add delimiter
	Metadata, Blob  io.ReaderFrom
}

func (*Reader) ReadFrom

func (mr *Reader) ReadFrom(r io.Reader) (n int64, err error)

type TypedMetadataCoder

type TypedMetadataCoder[O any] struct{}

func (TypedMetadataCoder[O]) DecodeFrom

func (TypedMetadataCoder[O]) DecodeFrom(
	subject *TypedStruct[O],
	reader io.Reader,
) (n int64, err error)

func (TypedMetadataCoder[O]) EncodeTo

func (TypedMetadataCoder[O]) EncodeTo(
	subject *TypedStruct[O],
	writer io.Writer,
) (n int64, err error)

type TypedStruct

type TypedStruct[S any] struct {
	Type   *ids.Type
	Struct S
}

func (*TypedStruct[S]) GetType

func (typedStruct *TypedStruct[S]) GetType() *ids.Type

type Writer

type Writer struct {
	Metadata, Blob io.WriterTo
}

func (Writer) WriteTo

func (w1 Writer) WriteTo(w2 io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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