internal

package
v0.0.0-...-40aa707 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package internal GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxInt

func MaxInt(bitSize uint) int64

func MaxUint

func MaxUint(bitSize uint) uint64

func MinInt

func MinInt(bitSize uint) int64

func Register

func Register(creator ValidatorProvider)

func UnmarshalDecode

func UnmarshalDecode(dec *jsontext.Decoder, out any, options ...jsontext.Options) error

Types

type Any

type Any struct {
	reflect.Value

	Validator Validator
}

func (*Any) RuntimeDoc

func (v *Any) RuntimeDoc(names ...string) ([]string, bool)

func (*Any) UnmarshalDecode

func (v *Any) UnmarshalDecode(dec *jsontext.Decoder, options json.Options) error

type Array

type Array struct {
	reflect.Value

	Validator Validator
}

func (*Array) RuntimeDoc

func (v *Array) RuntimeDoc(names ...string) ([]string, bool)

func (*Array) UnmarshalDecode

func (va *Array) UnmarshalDecode(dec *jsontext.Decoder, options json.Options) error

type Pointer

type Pointer struct {
	reflect.Value

	Validator Validator
}

func (*Pointer) RuntimeDoc

func (v *Pointer) RuntimeDoc(names ...string) ([]string, bool)

func (*Pointer) UnmarshalDecode

func (va *Pointer) UnmarshalDecode(dec *jsontext.Decoder, options json.Options) error

type PostValidator

type PostValidator interface {
	PostValidate(value reflect.Value) error
}

type Primitive

type Primitive struct {
	reflect.Value
	String    bool
	Validator Validator
}

func (*Primitive) RuntimeDoc

func (v *Primitive) RuntimeDoc(names ...string) ([]string, bool)

func (*Primitive) UnmarshalDecode

func (t *Primitive) UnmarshalDecode(dec *jsontext.Decoder, options json.Options) error

type Record

type Record struct {
	reflect.Value

	Validator Validator
}

func (*Record) RuntimeDoc

func (v *Record) RuntimeDoc(names ...string) ([]string, bool)

func (*Record) UnmarshalDecode

func (va *Record) UnmarshalDecode(dec *jsontext.Decoder, options json.Options) error

type Struct

type Struct struct {
	reflect.Value

	Validator Validator
}

func (*Struct) RuntimeDoc

func (v *Struct) RuntimeDoc(names ...string) ([]string, bool)

func (*Struct) UnmarshalDecode

func (va *Struct) UnmarshalDecode(dec *jsontext.Decoder, options json.Options) error

type Validator

type Validator interface {
	Validate(value jsontext.Value) error
	String() string
}

func New

func New(option ValidatorOption) (Validator, error)

func NewWithStructField

func NewWithStructField(sf *jsonflags.StructField) (Validator, error)

func Optional

func Optional(v Validator, defaultValue string) Validator

func Required

func Required(v Validator) Validator

type ValidatorOption

type ValidatorOption struct {
	Type         reflect.Type
	Rule         string
	String       bool
	Optional     bool
	DefaultValue string
}

func (*ValidatorOption) RuntimeDoc

func (v *ValidatorOption) RuntimeDoc(names ...string) ([]string, bool)

func (*ValidatorOption) SetDefaultValue

func (o *ValidatorOption) SetDefaultValue(v string) error

type ValidatorProvider

type ValidatorProvider interface {
	Names() []string
	Validator(rule *rules.Rule) (Validator, error)
}

type Value

type Value struct {
	reflect.Value

	Validator Validator
}

func (*Value) RuntimeDoc

func (v *Value) RuntimeDoc(names ...string) ([]string, bool)

func (*Value) UnmarshalDecode

func (va *Value) UnmarshalDecode(dec *jsontext.Decoder, options json.Options) (err error)

type WithDefaultValue

type WithDefaultValue interface {
	DefaultValue() jsontext.Value
}

type WithElem

type WithElem interface {
	Elem() ValidatorOption
}

type WithKey

type WithKey interface {
	Key() ValidatorOption
}

type WithOptional

type WithOptional interface {
	Optional() bool
}

Directories

Path Synopsis
+gengo:runtimedoc=false
+gengo:runtimedoc=false

Jump to

Keyboard shortcuts

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