defs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IntSize   = 4 << (^uint(0) >> 63)
	StackSize = 65536
)

Variables

View Source
var (
	MaxNesting  = parseOrDefault("FRUGAL_MAX_NESTING", _DefaultMaxNesting, 1)
	MaxILBuffer = parseOrDefault("FRUGAL_MAX_IL_BUFFER", _DefaultMaxILBuffer, 256)
)

Functions

func GetDefaultInitializer added in v0.1.2

func GetDefaultInitializer(vt reflect.Type) (unsafe.Pointer, error)

func GetSize

func GetSize(vt reflect.Type) int

Types

type DefaultInitializer added in v0.1.2

type DefaultInitializer interface {
	InitDefault()
}

type Field

type Field struct {
	F       int
	ID      uint16
	Type    *Type
	Spec    Requiredness
	Default reflect.Value
}

func ResolveFields

func ResolveFields(vt reflect.Type) ([]Field, error)

type Requiredness

type Requiredness uint8
const (
	Default Requiredness = iota
	Required
	Optional
)

type Tag

type Tag uint8
const (
	T_bool    Tag = 2
	T_i8      Tag = 3
	T_double  Tag = 4
	T_i16     Tag = 6
	T_i32     Tag = 8
	T_i64     Tag = 10
	T_string  Tag = 11
	T_struct  Tag = 12
	T_map     Tag = 13
	T_set     Tag = 14
	T_list    Tag = 15
	T_enum    Tag = 0x80
	T_binary  Tag = 0x81
	T_pointer Tag = 0x82
)

func T_int

func T_int() Tag

func (Tag) IsWireTag

func (self Tag) IsWireTag() bool

type Type

type Type struct {
	T Tag
	K *Type
	V *Type
	S reflect.Type
}

func ParseType

func ParseType(vt reflect.Type, def string) *Type

func (*Type) Free

func (self *Type) Free()

func (*Type) IsKeyType added in v0.1.2

func (self *Type) IsKeyType() bool

func (*Type) IsSimpleType added in v0.1.2

func (self *Type) IsSimpleType() bool

func (*Type) String

func (self *Type) String() string

func (*Type) Tag

func (self *Type) Tag() Tag

Jump to

Keyboard shortcuts

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