flow

package module
v0.0.0-...-daa15ce Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: BSD-2-Clause Imports: 11 Imported by: 1

README

ogdl/flow

Build Status Coverage Status

Go's encoding package for ODGL flow syntax.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) ([]byte, error)

func MarshalIndent

func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)

MarshalIndent is like Marshal but applies Indent to format the output.

func Register

func Register(value interface{})

func RegisterName

func RegisterName(name string, value interface{})

Types

type Composer

type Composer interface {
	io.Writer
	SyntaxComposer
	ComposeAny(v reflect.Value) error
}

type DecodeFunc

type DecodeFunc func(parser Parser) error

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Decode

func (dec *Decoder) Decode(v interface{}) error

func (Decoder) GoToOnlyChild

func (t Decoder) GoToOnlyChild() error

func (*Decoder) ParseAny

func (dec *Decoder) ParseAny(v reflect.Value) (err error)

func (Decoder) ParseList

func (t Decoder) ParseList(parseElem func(int) error) error

func (Decoder) Value

func (t Decoder) Value() ([]byte, error)

type EncodeFunc

type EncodeFunc func(c Composer) error

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) ComposeAny

func (enc *Encoder) ComposeAny(v reflect.Value) error

encode never returns an error, it may panics with bytes.ErrTooLarge.

func (*Encoder) ComposeList

func (t *Encoder) ComposeList(length int, composeElem func(i int) error) error

func (*Encoder) Encode

func (enc *Encoder) Encode(v interface{}) error

func (*Encoder) Indented

func (t *Encoder) Indented() bool

type Encoding

type Encoding struct {
	Encode EncodeFunc
	Decode DecodeFunc
}

type Marshaler

type Marshaler interface {
	MarshalOGDL() ([]byte, error)
}

type MatchFunc

type MatchFunc func(v reflect.Value) (*Encoding, bool)

type Parser

type Parser interface {
	Value() ([]byte, error)
	ParseList(walkFn func(int) error) error
	ParseAny(v reflect.Value) error
	GoToOnlyChild() error
}

type SyntaxComposer

type SyntaxComposer interface {
	ComposeList(length int, composeElem func(i int) error) error
	Indented() bool
}

type Unmarshaler

type Unmarshaler interface {
	UnmarshalOGDL([]byte) error
}

type ValueDecodeFunc

type ValueDecodeFunc func(val []byte, v reflect.Value) error

type ValueEncodeFunc

type ValueEncodeFunc func(v reflect.Value, w io.Writer) error

type ValueEncoding

type ValueEncoding struct {
	Encode ValueEncodeFunc
	Decode ValueDecodeFunc
}

func (ValueEncoding) ToDecode

func (e ValueEncoding) ToDecode(v reflect.Value) DecodeFunc

func (ValueEncoding) ToEncode

func (e ValueEncoding) ToEncode(v reflect.Value) EncodeFunc

func (ValueEncoding) ToEncoding

func (e ValueEncoding) ToEncoding(v reflect.Value) *Encoding

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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