types

package
v1.16.11 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Int     = TypeOf(0)
	Int8    = TypeOf(int8(0))
	Int16   = TypeOf(int16(0))
	Int32   = TypeOf(int32(0))
	Int64   = TypeOf(int64(0))
	Uint    = TypeOf(uint(0))
	Uint8   = TypeOf(uint8(0))
	Uint16  = TypeOf(uint16(0))
	Uint32  = TypeOf(uint32(0))
	Uint64  = TypeOf(uint64(0))
	Float   = TypeOf(float32(0))
	Float64 = TypeOf(float64(0))
	String  = TypeOf("")
	Bool    = TypeOf(true)
	Nil     = nilType{}
	Any     = anyType{}
)

Functions

This section is empty.

Types

type Map

type Map map[string]Type

Map returns a type that represents a map of the given type. The map is not strict, meaning that it can contain keys not defined in the map.

func (Map) Equal

func (m Map) Equal(t Type) bool

func (Map) Nature

func (m Map) Nature() Nature

func (Map) String

func (m Map) String() string

type StrictMap

type StrictMap map[string]Type

StrictMap returns a type that represents a map of the given type. The map is strict, meaning that it can only contain keys defined in the map.

func (StrictMap) Equal

func (m StrictMap) Equal(t Type) bool

func (StrictMap) Nature

func (m StrictMap) Nature() Nature

func (StrictMap) String

func (m StrictMap) String() string

type Type

type Type interface {
	Nature() Nature
	Equal(Type) bool
	String() string
}

Type is a type that can be used to represent a value.

func Array

func Array(of Type) Type

Array returns a type that represents an array of the given type.

func TypeOf

func TypeOf(v any) Type

Jump to

Keyboard shortcuts

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