types

package
v0.24.4-beta Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OptMissFieldError error

Special error to indicate that an optional field is missing

Functions

func AddCustomObjTypes

func AddCustomObjTypes(customDefs []spec.ObjectDef)

func GetTypeInfo

func GetTypeInfo(typename string) map[string]string

func GetTypes

func GetTypes() []string

Types

type IType

type IType interface {
	TypeName() string
	Value() interface{}
	GetMethod(string) Method
}

func MakeType

func MakeType(typename string, value interface{}) (IType, error)

type Method

type Method func(args []IType) (IType, error)

The return values of a check must be as follows: Method can be correctly executed, and the condition checked is true:

  • return &tBool{value: true}, nil

Method can be correctly executed, but the condition checked is false:

  • return &tBool{value: false}, error("message indicating why the check failed")

Method cannot be correctly executed (the arguments are invalid):

  • return nil, error("error message")

Jump to

Keyboard shortcuts

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