mdl

package
v0.0.0-...-309cb8d Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Copyright 2017 karma.run AG. All rights reserved. Use of this source code is governed by an AGPL license that can be found in the LICENSE file.

Index

Constants

View Source
const (
	FormatDateTime = time.RFC3339
)

Variables

View Source
var EmptyStruct = NewStruct(0)

Functions

func ModelToHuman

func ModelToHuman(m Model) string

func ValueFromModel

func ValueFromModel(metaId string, model Model, recursions map[*Recursion]struct{}) val.Value

ValueFromModel returns a Value representation of Model model.

Types

type Annotation

type Annotation struct {
	Value string
	Model Model
}

func (Annotation) Concrete

func (m Annotation) Concrete() Model

func (Annotation) Copy

func (m Annotation) Copy() Model

func (Annotation) Equals

func (m Annotation) Equals(n Model) bool

func (Annotation) Nullable

func (a Annotation) Nullable() bool

func (Annotation) Transform

func (m Annotation) Transform(f func(Model) Model) Model

func (Annotation) Traverse

func (w Annotation) Traverse(p []string, f func([]string, Model))

func (Annotation) TraverseValue

func (w Annotation) TraverseValue(j val.Value, f func(val.Value, Model))

func (Annotation) Unwrap

func (m Annotation) Unwrap() Model

func (Annotation) Validate

func (m Annotation) Validate(v val.Value, p err.ErrorPath) err.Error

func (Annotation) ValueType

func (m Annotation) ValueType() val.Type

func (Annotation) Zero

func (r Annotation) Zero() val.Value

func (Annotation) Zeroable

func (a Annotation) Zeroable() bool

type Any

type Any struct{}

Any behaves like a top type

func (Any) Concrete

func (m Any) Concrete() Model

func (Any) Copy

func (m Any) Copy() Model

func (Any) Equals

func (m Any) Equals(n Model) bool

func (Any) Nullable

func (Any) Nullable() bool

func (Any) Transform

func (m Any) Transform(f func(Model) Model) Model

func (Any) Traverse

func (r Any) Traverse(p []string, f func([]string, Model))

func (Any) TraverseValue

func (a Any) TraverseValue(j val.Value, f func(val.Value, Model))

func (Any) Unwrap

func (m Any) Unwrap() Model

func (Any) Validate

func (m Any) Validate(v val.Value, p err.ErrorPath) err.Error

func (Any) ValueType

func (Any) ValueType() val.Type

func (Any) Zero

func (r Any) Zero() val.Value

func (Any) Zeroable

func (Any) Zeroable() bool

type Bool

type Bool struct{}

func (Bool) Concrete

func (m Bool) Concrete() Model

func (Bool) Copy

func (m Bool) Copy() Model

func (Bool) Equals

func (m Bool) Equals(n Model) bool

func (Bool) Nullable

func (Bool) Nullable() bool

func (Bool) Transform

func (m Bool) Transform(f func(Model) Model) Model

func (Bool) Traverse

func (r Bool) Traverse(p []string, f func([]string, Model))

func (Bool) TraverseValue

func (b Bool) TraverseValue(j val.Value, f func(val.Value, Model))

func (Bool) Unwrap

func (m Bool) Unwrap() Model

func (Bool) Validate

func (m Bool) Validate(v val.Value, p err.ErrorPath) err.Error

func (Bool) ValueType

func (Bool) ValueType() val.Type

func (Bool) Zero

func (r Bool) Zero() val.Value

func (Bool) Zeroable

func (Bool) Zeroable() bool

type DateTime

type DateTime struct{}

func (DateTime) Concrete

func (m DateTime) Concrete() Model

func (DateTime) Copy

func (o DateTime) Copy() Model

func (DateTime) Equals

func (m DateTime) Equals(n Model) bool

func (DateTime) Nullable

func (DateTime) Nullable() bool

func (DateTime) Transform

func (m DateTime) Transform(f func(Model) Model) Model

func (DateTime) Traverse

func (r DateTime) Traverse(p []string, f func([]string, Model))

func (DateTime) TraverseValue

func (o DateTime) TraverseValue(j val.Value, f func(val.Value, Model))

func (DateTime) Unwrap

func (m DateTime) Unwrap() Model

func (DateTime) Validate

func (m DateTime) Validate(v val.Value, p err.ErrorPath) err.Error

func (DateTime) ValueType

func (DateTime) ValueType() val.Type

func (DateTime) Zero

func (r DateTime) Zero() val.Value

func (DateTime) Zeroable

func (DateTime) Zeroable() bool

type Enum

type Enum map[string]struct{}

func (Enum) Concrete

func (m Enum) Concrete() Model

func (Enum) Copy

func (s Enum) Copy() Model

func (Enum) Equals

func (m Enum) Equals(n Model) bool

func (Enum) Nullable

func (Enum) Nullable() bool

func (Enum) Transform

func (m Enum) Transform(f func(Model) Model) Model

func (Enum) Traverse

func (s Enum) Traverse(p []string, f func([]string, Model))

func (Enum) TraverseValue

func (m Enum) TraverseValue(v val.Value, f func(val.Value, Model))

func (Enum) Unwrap

func (m Enum) Unwrap() Model

func (Enum) Validate

func (m Enum) Validate(v val.Value, p err.ErrorPath) err.Error

func (Enum) ValueType

func (Enum) ValueType() val.Type

func (Enum) Zero

func (m Enum) Zero() val.Value

func (Enum) Zeroable

func (Enum) Zeroable() bool

type Float

type Float struct{}

func (Float) Concrete

func (m Float) Concrete() Model

func (Float) Copy

func (f Float) Copy() Model

func (Float) Equals

func (m Float) Equals(n Model) bool

func (Float) Nullable

func (Float) Nullable() bool

func (Float) Transform

func (m Float) Transform(f func(Model) Model) Model

func (Float) Traverse

func (r Float) Traverse(p []string, f func([]string, Model))

func (Float) TraverseValue

func (s Float) TraverseValue(j val.Value, f func(val.Value, Model))

func (Float) Unwrap

func (m Float) Unwrap() Model

func (Float) Validate

func (m Float) Validate(v val.Value, p err.ErrorPath) err.Error

func (Float) ValueType

func (Float) ValueType() val.Type

func (Float) Zero

func (r Float) Zero() val.Value

func (Float) Zeroable

func (Float) Zeroable() bool

type Int16

type Int16 struct{}

func (Int16) Concrete

func (m Int16) Concrete() Model

func (Int16) Copy

func (i Int16) Copy() Model

func (Int16) Equals

func (m Int16) Equals(n Model) bool

func (Int16) Nullable

func (Int16) Nullable() bool

func (Int16) Transform

func (m Int16) Transform(f func(Model) Model) Model

func (Int16) Traverse

func (r Int16) Traverse(p []string, f func([]string, Model))

func (Int16) TraverseValue

func (i Int16) TraverseValue(j val.Value, f func(val.Value, Model))

func (Int16) Unwrap

func (m Int16) Unwrap() Model

func (Int16) Validate

func (m Int16) Validate(v val.Value, p err.ErrorPath) err.Error

func (Int16) ValueType

func (Int16) ValueType() val.Type

func (Int16) Zero

func (r Int16) Zero() val.Value

func (Int16) Zeroable

func (Int16) Zeroable() bool

type Int32

type Int32 struct{}

func (Int32) Concrete

func (m Int32) Concrete() Model

func (Int32) Copy

func (i Int32) Copy() Model

func (Int32) Equals

func (m Int32) Equals(n Model) bool

func (Int32) Nullable

func (Int32) Nullable() bool

func (Int32) Transform

func (m Int32) Transform(f func(Model) Model) Model

func (Int32) Traverse

func (r Int32) Traverse(p []string, f func([]string, Model))

func (Int32) TraverseValue

func (i Int32) TraverseValue(j val.Value, f func(val.Value, Model))

func (Int32) Unwrap

func (m Int32) Unwrap() Model

func (Int32) Validate

func (m Int32) Validate(v val.Value, p err.ErrorPath) err.Error

func (Int32) ValueType

func (Int32) ValueType() val.Type

func (Int32) Zero

func (r Int32) Zero() val.Value

func (Int32) Zeroable

func (Int32) Zeroable() bool

type Int64

type Int64 struct{}

func (Int64) Concrete

func (m Int64) Concrete() Model

func (Int64) Copy

func (i Int64) Copy() Model

func (Int64) Equals

func (m Int64) Equals(n Model) bool

func (Int64) Nullable

func (Int64) Nullable() bool

func (Int64) Transform

func (m Int64) Transform(f func(Model) Model) Model

func (Int64) Traverse

func (r Int64) Traverse(p []string, f func([]string, Model))

func (Int64) TraverseValue

func (i Int64) TraverseValue(j val.Value, f func(val.Value, Model))

func (Int64) Unwrap

func (m Int64) Unwrap() Model

func (Int64) Validate

func (m Int64) Validate(v val.Value, p err.ErrorPath) err.Error

func (Int64) ValueType

func (Int64) ValueType() val.Type

func (Int64) Zero

func (r Int64) Zero() val.Value

func (Int64) Zeroable

func (Int64) Zeroable() bool

type Int8

type Int8 struct{}

func (Int8) Concrete

func (m Int8) Concrete() Model

func (Int8) Copy

func (i Int8) Copy() Model

func (Int8) Equals

func (m Int8) Equals(n Model) bool

func (Int8) Nullable

func (Int8) Nullable() bool

func (Int8) Transform

func (m Int8) Transform(f func(Model) Model) Model

func (Int8) Traverse

func (r Int8) Traverse(p []string, f func([]string, Model))

func (Int8) TraverseValue

func (i Int8) TraverseValue(j val.Value, f func(val.Value, Model))

func (Int8) Unwrap

func (m Int8) Unwrap() Model

func (Int8) Validate

func (m Int8) Validate(v val.Value, p err.ErrorPath) err.Error

func (Int8) ValueType

func (Int8) ValueType() val.Type

func (Int8) Zero

func (r Int8) Zero() val.Value

func (Int8) Zeroable

func (Int8) Zeroable() bool

type List

type List struct {
	Elements Model
}

func (List) Concrete

func (m List) Concrete() Model

func (List) Copy

func (l List) Copy() Model

func (List) Equals

func (m List) Equals(n Model) bool

func (List) Nullable

func (List) Nullable() bool

func (List) Transform

func (m List) Transform(f func(Model) Model) Model

func (List) Traverse

func (r List) Traverse(p []string, f func([]string, Model))

func (List) TraverseValue

func (l List) TraverseValue(j val.Value, f func(val.Value, Model))

func (List) Unwrap

func (m List) Unwrap() Model

func (List) Validate

func (m List) Validate(v val.Value, p err.ErrorPath) err.Error

func (List) ValueType

func (List) ValueType() val.Type

func (List) Zero

func (r List) Zero() val.Value

func (List) Zeroable

func (List) Zeroable() bool

type Map

type Map struct {
	Elements Model
}

func (Map) Concrete

func (m Map) Concrete() Model

func (Map) Copy

func (m Map) Copy() Model

func (Map) Equals

func (m Map) Equals(n Model) bool

func (Map) Nullable

func (Map) Nullable() bool

func (Map) Transform

func (m Map) Transform(f func(Model) Model) Model

func (Map) Traverse

func (r Map) Traverse(p []string, f func([]string, Model))

func (Map) TraverseValue

func (m Map) TraverseValue(j val.Value, f func(val.Value, Model))

func (Map) Unwrap

func (m Map) Unwrap() Model

func (Map) Validate

func (m Map) Validate(v val.Value, p err.ErrorPath) err.Error

func (Map) ValueType

func (Map) ValueType() val.Type

func (Map) Zero

func (r Map) Zero() val.Value

func (Map) Zeroable

func (Map) Zeroable() bool

type Model

type Model interface {

	// Validate returns nil for val.Values that fit the given Model
	// It returns an error for everything else
	Validate(v val.Value, p err.ErrorPath) err.Error

	// Copy copies a Model tree. It's equivalent to calling
	// Transform(mdl.TransformationIdentity)
	Copy() Model

	// Transform traverses a Model tree and returns the result
	// of mapping each of its nodes through function f.
	Transform(f func(Model) Model) Model

	// Zero returns the zero-value for the current model.
	// This is not possible with all model configurations,
	// especially not Refs. See Zeroable.
	Zero() val.Value

	// Zeroable reports wether calling Zero() on this Model is legal.
	Zeroable() bool

	// Unwrap returns the shallowest Model defined in
	// this package in a Model tree.
	Unwrap() Model

	// Concrete unwraps a Model to the shallowest Model that
	// affects its Value representation. In other words,
	// it removes semantic wrappers.
	Concrete() Model

	// Equals reports wether a Model tree equals another.
	Equals(Model) bool

	// Nullable reports wether a Model can be Null.
	Nullable() bool

	// TraverseValue traverses a Value tree v, calling function f
	// for every legal Value/Model combination therein.
	TraverseValue(v val.Value, f func(val.Value, Model))

	// Traverse is obsolete but still needed. Do not use it.
	Traverse([]string, func([]string, Model))

	// Returns the top-level Type of the Values in the set
	// of a Model. Returns TypeInvalid in case of Any and Or.
	ValueType() val.Type
}

Model represents a possibly nested and/or recursive data type.

func Either

func Either(l, r Model, m map[*Recursion]*Recursion) Model

func ModelFromValue

func ModelFromValue(metaId string, u val.Union, recursions map[string]*Recursion) (Model, err.PathedError)

ModelFromValue returns a Model from its Value representation.

func NewOptional

func NewOptional(m Model) Model

func TightestModelForValue

func TightestModelForValue(v val.Value) Model

NOTE: Abstain from using directly!

Consider calling kvm.inferType instead.

func UnionOf

func UnionOf(ms ...Model) Model

type Null

type Null struct{}

func (Null) Concrete

func (m Null) Concrete() Model

func (Null) Copy

func (l Null) Copy() Model

func (Null) Equals

func (m Null) Equals(n Model) bool

func (Null) Nullable

func (Null) Nullable() bool

func (Null) Transform

func (m Null) Transform(f func(Model) Model) Model

func (Null) Traverse

func (r Null) Traverse(p []string, f func([]string, Model))

func (Null) TraverseValue

func (l Null) TraverseValue(j val.Value, f func(val.Value, Model))

func (Null) Unwrap

func (m Null) Unwrap() Model

func (Null) Validate

func (m Null) Validate(v val.Value, p err.ErrorPath) err.Error

func (Null) ValueType

func (Null) ValueType() val.Type

func (Null) Zero

func (r Null) Zero() val.Value

func (Null) Zeroable

func (Null) Zeroable() bool

type Optional

type Optional struct {
	Model Model
}

func (Optional) Concrete

func (m Optional) Concrete() Model

func (Optional) Copy

func (m Optional) Copy() Model

func (Optional) Equals

func (m Optional) Equals(n Model) bool

func (Optional) Nullable

func (Optional) Nullable() bool

func (Optional) Transform

func (m Optional) Transform(f func(Model) Model) Model

func (Optional) Traverse

func (m Optional) Traverse(p []string, f func([]string, Model))

func (Optional) TraverseValue

func (m Optional) TraverseValue(j val.Value, f func(val.Value, Model))

func (Optional) Unwrap

func (m Optional) Unwrap() Model

func (Optional) Validate

func (m Optional) Validate(v val.Value, p err.ErrorPath) err.Error

func (Optional) ValueType

func (m Optional) ValueType() val.Type

func (Optional) Zero

func (m Optional) Zero() val.Value

func (Optional) Zeroable

func (Optional) Zeroable() bool

type Recursion

type Recursion struct {
	Label string
	Model Model
	// contains filtered or unexported fields
}

func DefineRecursion

func DefineRecursion(label string, definition func(*Recursion) Model) *Recursion

func NewRecursion

func NewRecursion(label string) *Recursion

func (*Recursion) Concrete

func (m *Recursion) Concrete() Model

func (*Recursion) Copy

func (r *Recursion) Copy() Model

func (*Recursion) Equals

func (m *Recursion) Equals(n Model) bool

func (*Recursion) Nullable

func (r *Recursion) Nullable() bool

func (*Recursion) Transform

func (r *Recursion) Transform(f func(Model) Model) Model

func (*Recursion) Traverse

func (r *Recursion) Traverse(p []string, f func([]string, Model))

func (*Recursion) TraverseValue

func (r *Recursion) TraverseValue(j val.Value, f func(val.Value, Model))

func (*Recursion) Unwrap

func (m *Recursion) Unwrap() Model

func (*Recursion) Validate

func (m *Recursion) Validate(v val.Value, p err.ErrorPath) err.Error

func (*Recursion) ValueType

func (m *Recursion) ValueType() val.Type

func (*Recursion) Zero

func (r *Recursion) Zero() val.Value

func (*Recursion) Zeroable

func (r *Recursion) Zeroable() bool

type Ref

type Ref struct {
	Model string
}

func (Ref) Concrete

func (m Ref) Concrete() Model

func (Ref) Copy

func (r Ref) Copy() Model

func (Ref) Equals

func (m Ref) Equals(n Model) bool

func (Ref) Nullable

func (Ref) Nullable() bool

func (Ref) Transform

func (m Ref) Transform(f func(Model) Model) Model

func (Ref) Traverse

func (r Ref) Traverse(p []string, f func([]string, Model))

func (Ref) TraverseValue

func (r Ref) TraverseValue(j val.Value, f func(val.Value, Model))

func (Ref) Unwrap

func (m Ref) Unwrap() Model

func (Ref) Validate

func (m Ref) Validate(v val.Value, p err.ErrorPath) err.Error

func (Ref) ValueType

func (Ref) ValueType() val.Type

func (Ref) Zero

func (r Ref) Zero() val.Value

func (Ref) Zeroable

func (Ref) Zeroable() bool

type Set

type Set struct {
	Elements Model
}

func (Set) Concrete

func (m Set) Concrete() Model

func (Set) Copy

func (l Set) Copy() Model

func (Set) Equals

func (m Set) Equals(n Model) bool

func (Set) Nullable

func (Set) Nullable() bool

func (Set) Transform

func (m Set) Transform(f func(Model) Model) Model

func (Set) Traverse

func (r Set) Traverse(p []string, f func([]string, Model))

func (Set) TraverseValue

func (l Set) TraverseValue(j val.Value, f func(val.Value, Model))

func (Set) Unwrap

func (m Set) Unwrap() Model

func (Set) Validate

func (m Set) Validate(v val.Value, p err.ErrorPath) err.Error

func (Set) ValueType

func (Set) ValueType() val.Type

func (Set) Zero

func (r Set) Zero() val.Value

func (Set) Zeroable

func (Set) Zeroable() bool

type String

type String struct{}

func (String) Concrete

func (m String) Concrete() Model

func (String) Copy

func (s String) Copy() Model

func (String) Equals

func (m String) Equals(n Model) bool

func (String) Nullable

func (String) Nullable() bool

func (String) Transform

func (m String) Transform(f func(Model) Model) Model

func (String) Traverse

func (r String) Traverse(p []string, f func([]string, Model))

func (String) TraverseValue

func (s String) TraverseValue(j val.Value, f func(val.Value, Model))

func (String) Unwrap

func (m String) Unwrap() Model

func (String) Validate

func (m String) Validate(v val.Value, p err.ErrorPath) err.Error

func (String) ValueType

func (String) ValueType() val.Type

func (String) Zero

func (r String) Zero() val.Value

func (String) Zeroable

func (String) Zeroable() bool

type Struct

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

func NewStruct

func NewStruct(capacity int) Struct

func StructFromMap

func StructFromMap(mp map[string]Model) Struct

func (Struct) Concrete

func (m Struct) Concrete() Model

func (Struct) Copy

func (m Struct) Copy() Model

func (Struct) Equals

func (m Struct) Equals(w Model) bool

func (Struct) Field

func (m Struct) Field(k string) Model

func (Struct) ForEach

func (m Struct) ForEach(f func(string, Model) bool)

func (Struct) Get

func (m Struct) Get(k string) (Model, bool)

func (Struct) Keys

func (m Struct) Keys() []string

func (Struct) Len

func (m Struct) Len() int

func (Struct) Nullable

func (Struct) Nullable() bool

func (Struct) Set

func (m Struct) Set(k string, w Model)

func (Struct) Transform

func (m Struct) Transform(f func(Model) Model) Model

func (Struct) Traverse

func (m Struct) Traverse(p []string, f func([]string, Model))

func (Struct) TraverseValue

func (s Struct) TraverseValue(j val.Value, f func(val.Value, Model))

func (Struct) Unwrap

func (m Struct) Unwrap() Model

func (Struct) Validate

func (m Struct) Validate(v val.Value, p err.ErrorPath) err.Error

func (Struct) ValueType

func (Struct) ValueType() val.Type

func (Struct) Zero

func (m Struct) Zero() val.Value

func (Struct) Zeroable

func (m Struct) Zeroable() bool

type Tuple

type Tuple []Model

func (Tuple) Concrete

func (m Tuple) Concrete() Model

func (Tuple) Copy

func (s Tuple) Copy() Model

func (Tuple) Equals

func (m Tuple) Equals(n Model) bool

func (Tuple) Nullable

func (Tuple) Nullable() bool

func (Tuple) Transform

func (m Tuple) Transform(f func(Model) Model) Model

func (Tuple) Traverse

func (s Tuple) Traverse(p []string, f func([]string, Model))

func (Tuple) TraverseValue

func (s Tuple) TraverseValue(j val.Value, f func(val.Value, Model))

func (Tuple) Unwrap

func (m Tuple) Unwrap() Model

func (Tuple) Validate

func (m Tuple) Validate(v val.Value, p err.ErrorPath) err.Error

func (Tuple) ValueType

func (Tuple) ValueType() val.Type

func (Tuple) Zero

func (r Tuple) Zero() val.Value

func (Tuple) Zeroable

func (m Tuple) Zeroable() bool

type Uint16

type Uint16 struct{}

func (Uint16) Concrete

func (m Uint16) Concrete() Model

func (Uint16) Copy

func (i Uint16) Copy() Model

func (Uint16) Equals

func (m Uint16) Equals(n Model) bool

func (Uint16) Nullable

func (Uint16) Nullable() bool

func (Uint16) Transform

func (m Uint16) Transform(f func(Model) Model) Model

func (Uint16) Traverse

func (r Uint16) Traverse(p []string, f func([]string, Model))

func (Uint16) TraverseValue

func (i Uint16) TraverseValue(j val.Value, f func(val.Value, Model))

func (Uint16) Unwrap

func (m Uint16) Unwrap() Model

func (Uint16) Validate

func (m Uint16) Validate(v val.Value, p err.ErrorPath) err.Error

func (Uint16) ValueType

func (Uint16) ValueType() val.Type

func (Uint16) Zero

func (r Uint16) Zero() val.Value

func (Uint16) Zeroable

func (Uint16) Zeroable() bool

type Uint32

type Uint32 struct{}

func (Uint32) Concrete

func (m Uint32) Concrete() Model

func (Uint32) Copy

func (i Uint32) Copy() Model

func (Uint32) Equals

func (m Uint32) Equals(n Model) bool

func (Uint32) Nullable

func (Uint32) Nullable() bool

func (Uint32) Transform

func (m Uint32) Transform(f func(Model) Model) Model

func (Uint32) Traverse

func (r Uint32) Traverse(p []string, f func([]string, Model))

func (Uint32) TraverseValue

func (i Uint32) TraverseValue(j val.Value, f func(val.Value, Model))

func (Uint32) Unwrap

func (m Uint32) Unwrap() Model

func (Uint32) Validate

func (m Uint32) Validate(v val.Value, p err.ErrorPath) err.Error

func (Uint32) ValueType

func (Uint32) ValueType() val.Type

func (Uint32) Zero

func (r Uint32) Zero() val.Value

func (Uint32) Zeroable

func (Uint32) Zeroable() bool

type Uint64

type Uint64 struct{}

func (Uint64) Concrete

func (m Uint64) Concrete() Model

func (Uint64) Copy

func (i Uint64) Copy() Model

func (Uint64) Equals

func (m Uint64) Equals(n Model) bool

func (Uint64) Nullable

func (Uint64) Nullable() bool

func (Uint64) Transform

func (m Uint64) Transform(f func(Model) Model) Model

func (Uint64) Traverse

func (r Uint64) Traverse(p []string, f func([]string, Model))

func (Uint64) TraverseValue

func (i Uint64) TraverseValue(j val.Value, f func(val.Value, Model))

func (Uint64) Unwrap

func (m Uint64) Unwrap() Model

func (Uint64) Validate

func (m Uint64) Validate(v val.Value, p err.ErrorPath) err.Error

func (Uint64) ValueType

func (Uint64) ValueType() val.Type

func (Uint64) Zero

func (r Uint64) Zero() val.Value

func (Uint64) Zeroable

func (Uint64) Zeroable() bool

type Uint8

type Uint8 struct{}

func (Uint8) Concrete

func (m Uint8) Concrete() Model

func (Uint8) Copy

func (i Uint8) Copy() Model

func (Uint8) Equals

func (m Uint8) Equals(n Model) bool

func (Uint8) Nullable

func (Uint8) Nullable() bool

func (Uint8) Transform

func (m Uint8) Transform(f func(Model) Model) Model

func (Uint8) Traverse

func (r Uint8) Traverse(p []string, f func([]string, Model))

func (Uint8) TraverseValue

func (i Uint8) TraverseValue(j val.Value, f func(val.Value, Model))

func (Uint8) Unwrap

func (m Uint8) Unwrap() Model

func (Uint8) Validate

func (m Uint8) Validate(v val.Value, p err.ErrorPath) err.Error

func (Uint8) ValueType

func (Uint8) ValueType() val.Type

func (Uint8) Zero

func (r Uint8) Zero() val.Value

func (Uint8) Zeroable

func (Uint8) Zeroable() bool

type Union

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

func NewUnion

func NewUnion(capacity int) Union

func UnionFromMap

func UnionFromMap(mp map[string]Model) Union

func (Union) Case

func (m Union) Case(k string) Model

func (Union) Cases

func (m Union) Cases() []string

func (Union) Concrete

func (m Union) Concrete() Model

func (Union) Copy

func (m Union) Copy() Model

func (Union) Equals

func (m Union) Equals(w Model) bool

func (Union) ForEach

func (m Union) ForEach(f func(string, Model) bool)

func (Union) Get

func (m Union) Get(k string) (Model, bool)

func (Union) Keys

func (m Union) Keys() []string

func (Union) Len

func (m Union) Len() int

func (Union) Nullable

func (Union) Nullable() bool

func (Union) Set

func (m Union) Set(k string, w Model)

func (Union) Transform

func (m Union) Transform(f func(Model) Model) Model

func (Union) Traverse

func (m Union) Traverse(p []string, f func([]string, Model))

func (Union) TraverseValue

func (s Union) TraverseValue(j val.Value, f func(val.Value, Model))

func (Union) Unwrap

func (m Union) Unwrap() Model

func (Union) Validate

func (m Union) Validate(v val.Value, p err.ErrorPath) err.Error

func (Union) ValueType

func (Union) ValueType() val.Type

func (Union) Zero

func (m Union) Zero() val.Value

func (Union) Zeroable

func (m Union) Zeroable() bool

type Unique

type Unique struct {
	Model Model
}

func (Unique) Concrete

func (m Unique) Concrete() Model

func (Unique) Copy

func (o Unique) Copy() Model

func (Unique) Equals

func (m Unique) Equals(n Model) bool

func (Unique) Nullable

func (u Unique) Nullable() bool

func (Unique) Transform

func (m Unique) Transform(f func(Model) Model) Model

func (Unique) Traverse

func (r Unique) Traverse(p []string, f func([]string, Model))

func (Unique) TraverseValue

func (o Unique) TraverseValue(j val.Value, f func(val.Value, Model))

func (Unique) Unwrap

func (m Unique) Unwrap() Model

func (Unique) Validate

func (m Unique) Validate(v val.Value, p err.ErrorPath) err.Error

func (Unique) ValueType

func (m Unique) ValueType() val.Type

func (Unique) Zero

func (r Unique) Zero() val.Value

func (Unique) Zeroable

func (u Unique) Zeroable() bool

type ValidationError

type ValidationError struct {
	Want Model
	Have val.Value
	Path err.ErrorPath
}

func (ValidationError) AppendPath

func (ValidationError) Child

func (e ValidationError) Child() err.Error

func (ValidationError) Error

func (e ValidationError) Error() string

func (ValidationError) ErrorPath

func (e ValidationError) ErrorPath() err.ErrorPath

func (ValidationError) String

func (e ValidationError) String() string

func (ValidationError) Value

func (e ValidationError) Value() val.Union

Jump to

Keyboard shortcuts

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