automarshal

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArglistToJson

func ArglistToJson(args string) (json.RawMessage, error)

Types

type ArgReader

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

func NewArgReader

func NewArgReader(args string) *ArgReader

func (*ArgReader) Any

func (args *ArgReader) Any() (res any, e error)

func (*ArgReader) Array

func (args *ArgReader) Array() (res []any, e error)

func (*ArgReader) Assign

func (args *ArgReader) Assign(k rune) (r any, e error)

func (*ArgReader) Finished

func (r *ArgReader) Finished() bool

func (*ArgReader) ID

func (args *ArgReader) ID(tile bool) (res string, err error)

func (*ArgReader) Len

func (r *ArgReader) Len() int

func (*ArgReader) Number

func (args *ArgReader) Number() (res float64, e error)

func (*ArgReader) Object

func (args *ArgReader) Object() (res map[string]any, e error)

func (*ArgReader) Peek

func (r *ArgReader) Peek() rune

func (*ArgReader) Quoted

func (args *ArgReader) Quoted(q rune) (r string, e error)

func (*ArgReader) Read

func (r *ArgReader) Read() (res rune, e error)

func (*ArgReader) Remains

func (r *ArgReader) Remains() string

func (*ArgReader) Set

func (args *ArgReader) Set() (res map[string]any, e error)

func (*ArgReader) Significant

func (args *ArgReader) Significant() (char rune, err error)

func (*ArgReader) Skipspace

func (args *ArgReader) Skipspace()

func (*ArgReader) Take

func (r *ArgReader) Take(c rune) (e error)

func (*ArgReader) TakeAnyIf

func (r *ArgReader) TakeAnyIf(c *util.RuneSet) (rune, bool)

func (*ArgReader) TakeAnyN

func (r *ArgReader) TakeAnyN(c *util.RuneSet) string

func (*ArgReader) TakeFile

func (args *ArgReader) TakeFile() (res map[string]any, e error)

func (*ArgReader) TakeIf

func (r *ArgReader) TakeIf(c rune) bool

func (*ArgReader) TakePath

func (args *ArgReader) TakePath() (r string, e error)

func (*ArgReader) Text

func (args *ArgReader) Text() (res string, err error)

func (*ArgReader) Unmarshal

func (args *ArgReader) Unmarshal(arg any) (e error)

func (*ArgReader) Unread

func (r *ArgReader) Unread() error

type ID

type ID struct {
	ID   string
	Kind string
	// contains filtered or unexported fields
}

func (ID) Label

func (id ID) Label() string

func (ID) MarshalText

func (id ID) MarshalText() ([]byte, error)

func (ID) String

func (id ID) String() (r string)

func (*ID) UnmarshalText

func (id *ID) UnmarshalText(data []byte) (err error)

type Registry

type Registry[W any, I any] struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry[Wrapper any, IFace any]() *Registry[Wrapper, IFace]

func (*Registry[W, I]) Define

func (r *Registry[W, I]) Define(kind string, defaults any)

func (*Registry[W, I]) Marshal

func (r *Registry[W, I]) Marshal(value W) ([]byte, error)

func (*Registry[W, I]) RegisterNonObject

func (r *Registry[W, I]) RegisterNonObject(kind byte, factory func(*W, []byte) error)

func (*Registry[W, I]) Unmarshal

func (r *Registry[W, I]) Unmarshal(value *W, data []byte) (err error)

type WithDefaults

type WithDefaults interface {
	WithDefaults()
}

type WithDefaultsID

type WithDefaultsID interface {
	WithDefaults(ID)
}

Jump to

Keyboard shortcuts

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