Documentation
¶
Index ¶
- Constants
- func CheckAt[T any](e *ValidationError, c Codec[T], value T, path ...any)
- func Ctor(tag uint16, values ...rt.V) rt.V
- func MarshalJSON[T any](c Codec[T], value T, path ...any) ([]byte, error)
- func ReadIO(result rt.V) (rt.V, error)
- func UnmarshalJSON[T any](c Codec[T], data []byte, path ...any) (T, error)
- func Validate[T any](c Codec[T], value T, path ...any) error
- func Zero[T any]() (zero T)
- type Block
- type BlockOption
- type Codec
- func Big(kind string, bound string) Codec[*big.Int]
- func Bool() Codec[bool]
- func Char() Codec[rune]
- func Fin(bound string) Codec[uint64]
- func Fixed[T fixed](kind string, bits int) Codec[T]
- func Option[T any](item Codec[T]) Codec[*T]
- func Product[A, B any](a Codec[A], b Codec[B]) Codec[Pair[A, B]]
- func Ref[T any](desc func() *schema.Desc, to func(T) rt.V, from func(rt.V) T, ...) Codec[T]
- func Result[E, A any](e Codec[E], a Codec[A]) Codec[Except[E, A]]
- func Scalar[T any](kind string, bits int, to func(T) rt.V, from func(rt.V) T) Codec[T]
- func Sequence[T any](kind string, item Codec[T]) Codec[[]T]
- func String() Codec[string]
- func Unit() Codec[struct{}]
- type Except
- type ExceptError
- type IOError
- type Issue
- type Pair
- type ValidationError
Constants ¶
View Source
const GeneratorVersion = 6
View Source
const Version = "0.9.0"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct{}
func Lean ¶
func Lean(string, ...BlockOption) Block
func LeanFile ¶
func LeanFile(string, ...BlockOption) Block
type BlockOption ¶
type BlockOption struct{}
func Imports ¶
func Imports(...string) BlockOption
func Models ¶
func Models(...any) BlockOption
func Uses ¶
func Uses(...string) BlockOption
type Codec ¶
type Codec[T any] struct { Desc *schema.Desc ToLean func(T) rt.V FromLean func(rt.V) T Check func(*ValidationError, T) }
type ExceptError ¶
type ExceptError[E any] struct { Value E }
func (*ExceptError[E]) Error ¶
func (e *ExceptError[E]) Error() string
type ValidationError ¶
type ValidationError struct {
Issues []Issue
}
func (*ValidationError) Add ¶
func (e *ValidationError) Add(message string, path ...any)
func (*ValidationError) Err ¶
func (e *ValidationError) Err() error
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) Prefix ¶
func (e *ValidationError) Prefix(start int, path ...any)
Click to show internal directories.
Click to hide internal directories.