Documentation ¶
Index ¶
- type ArrayOfScalarField
- type BlockHook
- type BlockHookFunc
- type BlockSpec
- type ChildSpec
- type Container
- type Field
- type PathErrorType
- type PathSpec
- type ScalarField
- type ScalarSplit
- type SchemaSet
- type Scope
- func (sw *Scope) ChildBlock(name string, source SourceLocation) (*Scope, *WalkPathError)
- func (sw *Scope) CurrentBlock() Container
- func (sw *Scope) Field(name string, source SourceLocation, existingIsOk bool) (Field, *WalkPathError)
- func (sw *Scope) ListAttributes() []string
- func (sw *Scope) ListBlocks() []string
- func (sw *Scope) MergeScope(other *Scope) *Scope
- func (sw *Scope) PrintScope(logf func(string, ...interface{}))
- func (sw *Scope) RootBlock() Container
- func (sw *Scope) ScalarField(name string, source SourceLocation) (ScalarField, *WalkPathError)
- func (sw *Scope) SchemaNames() []string
- func (sw *Scope) TailScope() *Scope
- type SourceLocation
- type Tag
- type TagType
- type WalkPathError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayOfScalarField ¶
type BlockHook ¶
type BlockHook interface {
RunHook(j5reflect.ContainerField) error
}
type BlockHookFunc ¶
type BlockHookFunc func(j5reflect.ContainerField) error
func (BlockHookFunc) RunHook ¶
func (bh BlockHookFunc) RunHook(cf j5reflect.ContainerField) error
type BlockSpec ¶
type BlockSpec struct { DebugName string // Prints as context to the user Description *string // Field to place the description in Aliases map[string]PathSpec Name *Tag TypeSelect *Tag Qualifier *Tag // A qualifier maps to a new child block at this field OnlyDefined bool // Only allows blocks and attributes explicitly defined in Spec, otherwise merges all available in the schema // Callback to run after closing the block, to run validation, automatic // cleanup etc. RunAfter BlockHook ScalarSplit *ScalarSplit // contains filtered or unexported fields }
Defines customizations for a 'type', these should be set in the schema
type PathErrorType ¶
type PathErrorType int
const ( UnknownPathError PathErrorType = iota NodeNotContainer NodeNotScalar NodeNotScalarArray NodeNotFound RootNotFound )
type ScalarField ¶
type ScalarSplit ¶
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
func NewRootSchemaWalker ¶
func (*Scope) ChildBlock ¶
func (sw *Scope) ChildBlock(name string, source SourceLocation) (*Scope, *WalkPathError)
func (*Scope) CurrentBlock ¶
func (*Scope) Field ¶
func (sw *Scope) Field(name string, source SourceLocation, existingIsOk bool) (Field, *WalkPathError)
func (*Scope) ListAttributes ¶
func (*Scope) ListBlocks ¶
func (*Scope) MergeScope ¶
func (*Scope) PrintScope ¶
func (*Scope) ScalarField ¶
func (sw *Scope) ScalarField(name string, source SourceLocation) (ScalarField, *WalkPathError)
func (*Scope) SchemaNames ¶
type SourceLocation ¶
type Tag ¶
type TagType ¶
type TagType int
const ( // Set the scalar value at Path to the value of Tag. Oneofs are allowed at // the leaf, the default value of the property matching the tag is set. TagTypeScalar TagType // The leaf node at Path + Tag must be a container. Used on 'type select' // fields TagTypeTypeSelect // Leaf can be either type. // If it is a container, it must have a property matching the given name. // Then the container is included in the search path for attributes and // blocks. // If it is a scalar, the value is set, the search path does not change. // If it is a SplitRef scalar, the value is set, and if there are any // remaining blocks in the item they are added to the search path. TagTypeQualifier )
type WalkPathError ¶
type WalkPathError struct { Type PathErrorType // for unknown: Err error // for RootNotFound and NodeNotFound: Available []string Schema string Field string Path []string }
func (*WalkPathError) Error ¶
func (wpe *WalkPathError) Error() string
func (*WalkPathError) LongMessage ¶
func (wpe *WalkPathError) LongMessage() string
Click to show internal directories.
Click to hide internal directories.