defs

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

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
	Opts    Options
	Spec    Requiredness
	Default reflect.Value
}

func ResolveFields

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

type Options added in v0.1.4

type Options uint8
const (
	NoCopy Options = 1 << iota
)

func (Options) String added in v0.1.4

func (self Options) String() string

type Requiredness

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

func (Requiredness) String added in v0.1.4

func (self Requiredness) String() string

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, error)

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) IsValueType added in v0.1.6

func (self *Type) IsValueType() 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