decl

package
v0.0.0-...-9b93ea0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuiltinDecls string
View Source
var ErrBadDecl = errors.New("bad declaration of var `_`")

Functions

func IsBytes

func IsBytes(typ types.Type) bool

func IsComparable

func IsComparable(typ types.Type) bool

func IsOrdered

func IsOrdered(typ types.Type) bool

func IsSlice

func IsSlice(typ types.Type) bool

func IsString

func IsString(typ types.Type) bool

func IsStruct

func IsStruct(typ types.Type) bool

Types

type Parser

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

func (Parser) Parse

func (p Parser) Parse(values []ast.Expr) ([]*Validator, error)

type Range

type Range struct {
	Min, Max int
}

func (Range) Contain

func (r Range) Contain(n int) bool

type Types

type Types []string

func (Types) Allow

func (ts Types) Allow(typ types.Type) bool

type Validator

type Validator struct {
	Import       string
	Qualifier    string
	Name         string
	IsGeneric    bool
	Alias        string
	AllowedTypes Types
	ArgNum       Range
}

func Parse

func Parse(decls string) ([]*Validator, error)

Jump to

Keyboard shortcuts

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