internal

package
v2.0.0-alpha1+incompat... Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TagLabel allow to apply a custom behavior.
	// - "allowEmpty": allow to create an empty struct.
	// - "-": ignore the field.
	TagLabel = "label"

	// TagLabelSliceAsStruct allow to use a slice of struct by creating one entry into the slice.
	// The value is the substitution name use in the label to access the slice.
	TagLabelSliceAsStruct = "label-slice-as-struct"
)

Variables

This section is empty.

Functions

func AddMetadata

func AddMetadata(structure interface{}, node *Node) error

AddMetadata Adds metadata to a node. nodes + element -> nodes

func EncodeNode

func EncodeNode(node *Node) map[string]string

EncodeNode Converts a node to labels. nodes -> labels

func Fill

func Fill(element interface{}, node *Node) error

Fill the fields of the element. nodes -> element

Types

type Node

type Node struct {
	Name      string       `json:"name"`
	FieldName string       `json:"fieldName"`
	Value     string       `json:"value,omitempty"`
	Disabled  bool         `json:"disabled,omitempty"`
	Kind      reflect.Kind `json:"kind,omitempty"`
	Children  []*Node      `json:"children,omitempty"`
}

Node a label node.

func DecodeToNode

func DecodeToNode(labels map[string]string, filters ...string) (*Node, error)

DecodeToNode Converts the labels to a node. labels -> nodes

func EncodeToNode

func EncodeToNode(element interface{}) (*Node, error)

EncodeToNode Converts an element to a node. element -> nodes

Jump to

Keyboard shortcuts

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