Documentation ¶
Overview ¶
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Index ¶
- func As[A ...](x Schema) (A, bool)
- func AsDefault[A ...](x Schema, def A) A
- func BinaryShape() shape.Shape
- func BinaryToJSON(x *Binary) ([]byte, error)
- func BoolShape() shape.Shape
- func BoolToJSON(x *Bool) ([]byte, error)
- func Compare(a, b Schema) int
- func FieldShape() shape.Shape
- func IsNone(x Schema) bool
- func IsPrimitive(x any) bool
- func ListShape() shape.Shape
- func ListToJSON(x *List) ([]byte, error)
- func LocationAnythingToJSON(x *LocationAnything) ([]byte, error)
- func LocationFieldToJSON(x *LocationField) ([]byte, error)
- func LocationIndexToJSON(x *LocationIndex) ([]byte, error)
- func LocationToJSON(x Location) ([]byte, error)
- func LocationToStr(location []Location) string
- func MapShape() shape.Shape
- func MapToJSON(x *Map) ([]byte, error)
- func MatchLocation[TOut any](x Location, f1 func(x *LocationField) TOut, f2 func(x *LocationIndex) TOut, ...) TOut
- func MatchLocationR2[TOut1, TOut2 any](x Location, f1 func(x *LocationField) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MatchSchema[TOut any](x Schema, f1 func(x *None) TOut, f2 func(x *Bool) TOut, ...) TOut
- func MatchSchemaR2[TOut1, TOut2 any](x Schema, f1 func(x *None) (TOut1, TOut2), f2 func(x *Bool) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchLocation[TOut any](x Location, f1 func(x *LocationField) TOut, f2 func(x *LocationIndex) TOut, ...) TOut
- func MustMatchLocationR0(x Location, f1 func(x *LocationField), f2 func(x *LocationIndex), ...)
- func MustMatchLocationR2[TOut1, TOut2 any](x Location, f1 func(x *LocationField) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchSchema[TOut any](x Schema, f1 func(x *None) TOut, f2 func(x *Bool) TOut, ...) TOut
- func MustMatchSchemaR0(x Schema, f1 func(x *None), f2 func(x *Bool), f3 func(x *Number), ...)
- func MustMatchSchemaR2[TOut1, TOut2 any](x Schema, f1 func(x *None) (TOut1, TOut2), f2 func(x *Bool) (TOut1, TOut2), ...) (TOut1, TOut2)
- func NoneShape() shape.Shape
- func NoneToJSON(x *None) ([]byte, error)
- func NumberShape() shape.Shape
- func NumberToJSON(x *Number) ([]byte, error)
- func Reduce[A any](data Schema, init A, fn func(Schema, A) A) A
- func SchemaShape() shape.Shape
- func SchemaToJSON(x Schema) ([]byte, error)
- func StringShape() shape.Shape
- func StringToJSON(x *String) ([]byte, error)
- func ToDynamoDB(x Schema) types.AttributeValue
- func ToGo[A any](x Schema) A
- func ToGoG[A any](x Schema) (res A, err error)
- func ToGoPrimitive(x Schema) (any, error)
- func ToGoReflect(xshape shape.Shape, ydata Schema, zreflect reflect.Type) (reflect.Value, error)
- type Acc
- type Binary
- type Bool
- type Field
- type List
- type Location
- type LocationAnything
- type LocationField
- type LocationIndex
- type LocationUnionJSON
- type LocationVisitor
- type Map
- type None
- type Number
- type Part
- type PathAst
- type Schema
- func FromDynamoDB(x types.AttributeValue) (Schema, error)
- func FromGo[A any](x A) Schema
- func FromGoReflect(xschema shape.Shape, yreflect reflect.Value) Schema
- func FromPrimitiveGo(x any) Schema
- func Get[A any](data A, location string) (Schema, shape.Shape)
- func GetSchema(data Schema, location string) Schema
- func GetSchemaLocation(data Schema, locations []Location) Schema
- func GetShapeLocation(s shape.Shape, data Schema, location string) (Schema, shape.Shape)
- func GetShapeSchemaLocation(s shape.Shape, data Schema, locations []Location) (Schema, shape.Shape)
- func SchemaFromJSON(x []byte) (Schema, error)
- func UnwrapDynamoDB(data Schema) (Schema, error)
- type SchemaUnionJSON
- type SchemaVisitor
- type String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinaryShape ¶ added in v1.21.0
func BinaryToJSON ¶ added in v1.20.0
func BoolToJSON ¶ added in v1.20.0
func FieldShape ¶ added in v1.21.0
func IsPrimitive ¶ added in v1.21.0
func ListToJSON ¶ added in v1.20.0
func LocationAnythingToJSON ¶ added in v1.20.0
func LocationAnythingToJSON(x *LocationAnything) ([]byte, error)
func LocationFieldToJSON ¶ added in v1.20.0
func LocationFieldToJSON(x *LocationField) ([]byte, error)
func LocationIndexToJSON ¶ added in v1.20.0
func LocationIndexToJSON(x *LocationIndex) ([]byte, error)
func LocationToJSON ¶ added in v1.20.0
func LocationToStr ¶ added in v1.19.0
func MatchLocation ¶ added in v1.19.0
func MatchLocation[TOut any]( x Location, f1 func(x *LocationField) TOut, f2 func(x *LocationIndex) TOut, f3 func(x *LocationAnything) TOut, df func(x Location) TOut, ) TOut
func MatchLocationR2 ¶ added in v1.19.0
func MatchLocationR2[TOut1, TOut2 any]( x Location, f1 func(x *LocationField) (TOut1, TOut2), f2 func(x *LocationIndex) (TOut1, TOut2), f3 func(x *LocationAnything) (TOut1, TOut2), df func(x Location) (TOut1, TOut2), ) (TOut1, TOut2)
func MatchSchema ¶ added in v1.10.0
func MatchSchemaR2 ¶ added in v1.10.0
func MatchSchemaR2[TOut1, TOut2 any]( x Schema, f1 func(x *None) (TOut1, TOut2), f2 func(x *Bool) (TOut1, TOut2), f3 func(x *Number) (TOut1, TOut2), f4 func(x *String) (TOut1, TOut2), f5 func(x *Binary) (TOut1, TOut2), f6 func(x *List) (TOut1, TOut2), f7 func(x *Map) (TOut1, TOut2), df func(x Schema) (TOut1, TOut2), ) (TOut1, TOut2)
func MustMatchLocation ¶ added in v1.19.0
func MustMatchLocation[TOut any]( x Location, f1 func(x *LocationField) TOut, f2 func(x *LocationIndex) TOut, f3 func(x *LocationAnything) TOut, ) TOut
func MustMatchLocationR0 ¶ added in v1.19.0
func MustMatchLocationR0( x Location, f1 func(x *LocationField), f2 func(x *LocationIndex), f3 func(x *LocationAnything), )
func MustMatchLocationR2 ¶ added in v1.19.0
func MustMatchLocationR2[TOut1, TOut2 any]( x Location, f1 func(x *LocationField) (TOut1, TOut2), f2 func(x *LocationIndex) (TOut1, TOut2), f3 func(x *LocationAnything) (TOut1, TOut2), ) (TOut1, TOut2)
func MustMatchSchema ¶ added in v1.7.3
func MustMatchSchemaR0 ¶ added in v1.14.1
func MustMatchSchemaR2 ¶ added in v1.7.3
func MustMatchSchemaR2[TOut1, TOut2 any]( x Schema, f1 func(x *None) (TOut1, TOut2), f2 func(x *Bool) (TOut1, TOut2), f3 func(x *Number) (TOut1, TOut2), f4 func(x *String) (TOut1, TOut2), f5 func(x *Binary) (TOut1, TOut2), f6 func(x *List) (TOut1, TOut2), f7 func(x *Map) (TOut1, TOut2), ) (TOut1, TOut2)
func NoneToJSON ¶ added in v1.20.0
func NumberShape ¶ added in v1.21.0
func NumberToJSON ¶ added in v1.20.0
func SchemaShape ¶ added in v1.21.0
func SchemaToJSON ¶ added in v1.20.0
func StringShape ¶ added in v1.21.0
func StringToJSON ¶ added in v1.20.0
func ToDynamoDB ¶ added in v1.7.7
func ToDynamoDB(x Schema) types.AttributeValue
func ToGoPrimitive ¶ added in v1.21.0
Types ¶
type Acc ¶ added in v1.19.0
type Acc struct { Name *string `@(String|Char|RawString)` Index *int `| @Int` Any bool `| @("*") ` }
func (Acc) ToAccessor ¶ added in v1.19.0
type Binary ¶ added in v1.11.0
type Binary []byte
func BinaryFromJSON ¶ added in v1.20.0
func (*Binary) AcceptSchema ¶ added in v1.15.0
func (r *Binary) AcceptSchema(v SchemaVisitor) any
func (*Binary) MarshalJSON ¶ added in v1.20.0
func (*Binary) UnmarshalJSON ¶ added in v1.20.0
type Bool ¶
type Bool bool
func BoolFromJSON ¶ added in v1.20.0
func (*Bool) AcceptSchema ¶ added in v1.15.0
func (r *Bool) AcceptSchema(v SchemaVisitor) any
func (*Bool) MarshalJSON ¶ added in v1.20.0
func (*Bool) UnmarshalJSON ¶ added in v1.20.0
type Field ¶
func (*Field) MarshalJSON ¶ added in v1.20.1
func (*Field) UnmarshalJSON ¶ added in v1.20.1
type List ¶
type List []Schema
func ListFromJSON ¶ added in v1.20.0
func (*List) AcceptSchema ¶ added in v1.15.0
func (r *List) AcceptSchema(v SchemaVisitor) any
func (*List) MarshalJSON ¶ added in v1.20.0
func (*List) UnmarshalJSON ¶ added in v1.20.0
type Location ¶ added in v1.19.0
type Location interface {
AcceptLocation(g LocationVisitor) any
}
func LocationFromJSON ¶ added in v1.20.0
func MustParseLocation ¶ added in v1.19.0
func ParseLocation ¶ added in v1.19.0
type LocationAnything ¶ added in v1.19.0
type LocationAnything struct{}
func LocationAnythingFromJSON ¶ added in v1.20.0
func LocationAnythingFromJSON(x []byte) (*LocationAnything, error)
func (*LocationAnything) AcceptLocation ¶ added in v1.19.0
func (r *LocationAnything) AcceptLocation(v LocationVisitor) any
func (*LocationAnything) MarshalJSON ¶ added in v1.20.0
func (r *LocationAnything) MarshalJSON() ([]byte, error)
func (*LocationAnything) UnmarshalJSON ¶ added in v1.20.0
func (r *LocationAnything) UnmarshalJSON(data []byte) error
type LocationField ¶ added in v1.19.0
type LocationField struct {
Name string
}
func LocationFieldFromJSON ¶ added in v1.20.0
func LocationFieldFromJSON(x []byte) (*LocationField, error)
func (*LocationField) AcceptLocation ¶ added in v1.19.0
func (r *LocationField) AcceptLocation(v LocationVisitor) any
func (*LocationField) MarshalJSON ¶ added in v1.20.0
func (r *LocationField) MarshalJSON() ([]byte, error)
func (*LocationField) UnmarshalJSON ¶ added in v1.20.0
func (r *LocationField) UnmarshalJSON(data []byte) error
type LocationIndex ¶ added in v1.19.0
type LocationIndex struct {
Index int
}
func LocationIndexFromJSON ¶ added in v1.20.0
func LocationIndexFromJSON(x []byte) (*LocationIndex, error)
func (*LocationIndex) AcceptLocation ¶ added in v1.19.0
func (r *LocationIndex) AcceptLocation(v LocationVisitor) any
func (*LocationIndex) MarshalJSON ¶ added in v1.20.0
func (r *LocationIndex) MarshalJSON() ([]byte, error)
func (*LocationIndex) UnmarshalJSON ¶ added in v1.20.0
func (r *LocationIndex) UnmarshalJSON(data []byte) error
type LocationUnionJSON ¶ added in v1.20.0
type LocationUnionJSON struct { Type string `json:"$type,omitempty"` LocationField json.RawMessage `json:"schema.LocationField,omitempty"` LocationIndex json.RawMessage `json:"schema.LocationIndex,omitempty"` LocationAnything json.RawMessage `json:"schema.LocationAnything,omitempty"` }
type LocationVisitor ¶ added in v1.19.0
type LocationVisitor interface { VisitLocationField(v *LocationField) any VisitLocationIndex(v *LocationIndex) any VisitLocationAnything(v *LocationAnything) any }
type Map ¶
func MapFromJSON ¶ added in v1.20.0
func (*Map) AcceptSchema ¶ added in v1.15.0
func (r *Map) AcceptSchema(v SchemaVisitor) any
func (*Map) MarshalJSON ¶ added in v1.20.0
func (*Map) UnmarshalJSON ¶ added in v1.20.0
type None ¶
type None struct{}
func NoneFromJSON ¶ added in v1.20.0
func (*None) AcceptSchema ¶ added in v1.15.0
func (r *None) AcceptSchema(v SchemaVisitor) any
func (*None) MarshalJSON ¶ added in v1.20.0
func (*None) UnmarshalJSON ¶ added in v1.20.0
type Number ¶
type Number float64
func NumberFromJSON ¶ added in v1.20.0
func (*Number) AcceptSchema ¶ added in v1.15.0
func (r *Number) AcceptSchema(v SchemaVisitor) any
func (*Number) MarshalJSON ¶ added in v1.20.0
func (*Number) UnmarshalJSON ¶ added in v1.20.0
type Part ¶ added in v1.19.0
func (Part) ToLocation ¶ added in v1.19.0
type PathAst ¶ added in v1.19.0
type PathAst struct {
Parts []Part `@@ ( "." @@ )*`
}
func (PathAst) ToLocation ¶ added in v1.19.0
type Schema ¶ added in v1.7.3
type Schema interface {
AcceptSchema(g SchemaVisitor) any
}
func FromDynamoDB ¶ added in v1.7.7
func FromDynamoDB(x types.AttributeValue) (Schema, error)
func FromGoReflect ¶ added in v1.21.0
func FromPrimitiveGo ¶ added in v1.21.0
func GetSchemaLocation ¶ added in v1.21.0
func GetShapeLocation ¶ added in v1.21.0
func GetShapeSchemaLocation ¶ added in v1.21.0
func SchemaFromJSON ¶ added in v1.20.0
func UnwrapDynamoDB ¶ added in v1.12.0
type SchemaUnionJSON ¶ added in v1.20.0
type SchemaUnionJSON struct { Type string `json:"$type,omitempty"` None json.RawMessage `json:"schema.None,omitempty"` Bool json.RawMessage `json:"schema.Bool,omitempty"` Number json.RawMessage `json:"schema.Number,omitempty"` String json.RawMessage `json:"schema.String,omitempty"` Binary json.RawMessage `json:"schema.Binary,omitempty"` List json.RawMessage `json:"schema.List,omitempty"` Map json.RawMessage `json:"schema.Map,omitempty"` }
type SchemaVisitor ¶ added in v1.7.3
type String ¶
type String string
func StringFromJSON ¶ added in v1.20.0
func (*String) AcceptSchema ¶ added in v1.15.0
func (r *String) AcceptSchema(v SchemaVisitor) any
func (*String) MarshalJSON ¶ added in v1.20.0
func (*String) UnmarshalJSON ¶ added in v1.20.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.