fieldpath

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const EOI rune = 0

Variables

This section is empty.

Functions

func IsIdentifierPart

func IsIdentifierPart(r rune) bool

func IsIdentifierStart

func IsIdentifierStart(r rune) bool

func NewScanner

func NewScanner(path string) *scanner

func Value

func Value(val interface{}) interface{}

Types

type Field

type Field interface {
	BaseType() reflect.Type
	Type() reflect.Type
	Get(base interface{}) (interface{}, error)
	GetAsValue(base interface{}) (interface{}, error)
	Set(base interface{}, value interface{}) error

	String() string
}

func NewField

func NewField(base interface{}, path string) (Field, error)

func RequiredField

func RequiredField(base interface{}, path string) Field

type FieldNode

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

func (*FieldNode) Get

func (this *FieldNode) Get(src interface{}) (interface{}, error)

func (*FieldNode) Next

func (this *FieldNode) Next() Node

func (*FieldNode) Set

func (this *FieldNode) Set(src interface{}, val interface{}) error

func (*FieldNode) String

func (this *FieldNode) String() string

func (*FieldNode) Type

func (this *FieldNode) Type(src interface{}) (reflect.Type, error)

func (*FieldNode) Validate

func (this *FieldNode) Validate(src interface{}) error

func (*FieldNode) ValidateType

func (this *FieldNode) ValidateType(src interface{}, val interface{}) error

type Node

type Node interface {
	Next() Node
	String() string

	Type(interface{}) (reflect.Type, error)
	Validate(interface{}) error
	ValidateType(interface{}, interface{}) error

	Get(interface{}) (interface{}, error)
	Set(interface{}, interface{}) error
	// contains filtered or unexported methods
}

func Compile

func Compile(path string) (Node, error)

func FieldPath

func FieldPath(path string) (Node, error)

func NewEntry

func NewEntry(index int, next Node) Node

func NewFieldNode

func NewFieldNode(name string, next Node) Node

func NewProjection

func NewProjection(path Node, next Node) Node

func NewSelection

func NewSelection(path Node, value interface{}, next Node) Node

func NewSlice

func NewSlice(start, end int, next Node) Node

type ProjectionNode

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

func (*ProjectionNode) Get

func (this *ProjectionNode) Get(src interface{}) (interface{}, error)

func (*ProjectionNode) Next

func (this *ProjectionNode) Next() Node

func (*ProjectionNode) Set

func (this *ProjectionNode) Set(src interface{}, val interface{}) error

func (*ProjectionNode) String

func (this *ProjectionNode) String() string

func (*ProjectionNode) Type

func (this *ProjectionNode) Type(src interface{}) (reflect.Type, error)

func (*ProjectionNode) Validate

func (this *ProjectionNode) Validate(src interface{}) error

func (*ProjectionNode) ValidateType

func (this *ProjectionNode) ValidateType(src interface{}, val interface{}) error

type SelectionNode

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

func (*SelectionNode) Get

func (this *SelectionNode) Get(src interface{}) (interface{}, error)

func (*SelectionNode) Next

func (this *SelectionNode) Next() Node

func (*SelectionNode) Set

func (this *SelectionNode) Set(src interface{}, val interface{}) error

func (*SelectionNode) String

func (this *SelectionNode) String() string

func (*SelectionNode) Type

func (this *SelectionNode) Type(src interface{}) (reflect.Type, error)

func (*SelectionNode) Validate

func (this *SelectionNode) Validate(src interface{}) error

func (*SelectionNode) ValidateType

func (this *SelectionNode) ValidateType(src interface{}, val interface{}) error

type SliceEntryNode

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

func (*SliceEntryNode) Get

func (this *SliceEntryNode) Get(src interface{}) (interface{}, error)

func (*SliceEntryNode) Next

func (this *SliceEntryNode) Next() Node

func (*SliceEntryNode) Set

func (this *SliceEntryNode) Set(src interface{}, val interface{}) error

func (*SliceEntryNode) String

func (this *SliceEntryNode) String() string

func (*SliceEntryNode) Type

func (this *SliceEntryNode) Type(src interface{}) (reflect.Type, error)

func (*SliceEntryNode) Validate

func (this *SliceEntryNode) Validate(src interface{}) error

func (*SliceEntryNode) ValidateType

func (this *SliceEntryNode) ValidateType(src interface{}, val interface{}) error

type SliceNode

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

func (*SliceNode) Get

func (this *SliceNode) Get(src interface{}) (interface{}, error)

func (*SliceNode) Next

func (this *SliceNode) Next() Node

func (*SliceNode) Set

func (this *SliceNode) Set(src interface{}, val interface{}) error

func (*SliceNode) String

func (this *SliceNode) String() string

func (*SliceNode) Type

func (this *SliceNode) Type(src interface{}) (reflect.Type, error)

func (*SliceNode) Validate

func (this *SliceNode) Validate(src interface{}) error

func (*SliceNode) ValidateType

func (this *SliceNode) ValidateType(src interface{}, val interface{}) error

Jump to

Keyboard shortcuts

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