def

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegistrySealedError = RegistryError{errors.New("registry sealed")}
)

Functions

func Enum

func Enum[T any](opts ...EnumOpt) any

func Inline

func Inline(fns ...any) any

func Specialize

func Specialize[T any](c any, cvs ...any) any

func WithInline

func WithInline(fns ...any) any

func X_addPackageDef

func X_addPackageDef(def PackageDef)

func X_defPackageName

func X_defPackageName() string

Types

type DefaultOpt

type DefaultOpt struct {
	Val any
	Ty  any
}

func Default

func Default(val any) DefaultOpt

type EnumDef

type EnumDef struct {
	Ty   any
	Opts []EnumOpt
}

type EnumOpt

type EnumOpt interface {
	// contains filtered or unexported methods
}

type EnumSpec

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

func NewEnumSpec

func NewEnumSpec(ty any, defs []EnumDef) *EnumSpec

func (EnumSpec) Defs

func (e EnumSpec) Defs() []EnumDef

func (EnumSpec) Opts

func (e EnumSpec) Opts() []EnumOpt

func (EnumSpec) Ty

func (e EnumSpec) Ty() any

type FieldDef

type FieldDef struct {
	Name string
	Opts []FieldOpt
}

func Field

func Field(name string, opts ...FieldOpt) FieldDef

type FieldOpt

type FieldOpt interface {
	// contains filtered or unexported methods
}

type FieldSpec

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

func NewFieldSpec

func NewFieldSpec(name string, defs []FieldDef) *FieldSpec

func (FieldSpec) Default

func (fs FieldSpec) Default() any

func (FieldSpec) Defs

func (fs FieldSpec) Defs() []FieldDef

func (FieldSpec) Meta

func (fs FieldSpec) Meta() ctr.Map[reflect.Type, any]

func (FieldSpec) Name

func (fs FieldSpec) Name() string

func (FieldSpec) Opts

func (fs FieldSpec) Opts() []FieldOpt

func (FieldSpec) RuntimeType

func (fs FieldSpec) RuntimeType() reflect.Type

func (FieldSpec) Type

func (fs FieldSpec) Type() any

type InitOpt

type InitOpt struct {
	Fn any
}

func Init

func Init(fn any) InitOpt

type InlineDef

type InlineDef struct {
	Fns []any
}

type MetaOpt

type MetaOpt struct {
	Value any
}

func Meta

func Meta(value any) MetaOpt

type PackageDef

type PackageDef interface {
	// contains filtered or unexported methods
}

type PackageSpec

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

func NewPackageSpec

func NewPackageSpec(name string, defs []PackageDef) *PackageSpec

func X_getPackageSpec

func X_getPackageSpec() *PackageSpec

func (PackageSpec) Enum

func (ps PackageSpec) Enum(ty any) *EnumSpec

func (PackageSpec) Enums

func (ps PackageSpec) Enums() []*EnumSpec

func (PackageSpec) Inlines

func (ps PackageSpec) Inlines() map[any]*InlineDef

func (PackageSpec) Name

func (ps PackageSpec) Name() string

func (PackageSpec) Struct

func (ps PackageSpec) Struct(ty any) *StructSpec

func (PackageSpec) Structs

func (ps PackageSpec) Structs() []*StructSpec

func (PackageSpec) WithInlines

func (ps PackageSpec) WithInlines() map[any]*WithInlineDef

type ReceiverOpt

type ReceiverOpt struct {
	Name string
}

func Receiver

func Receiver(name string) ReceiverOpt

type RegistryError

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

func (RegistryError) Error

func (e RegistryError) Error() string

func (RegistryError) Unwrap

func (e RegistryError) Unwrap() error

type SpecError

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

func (SpecError) Error

func (e SpecError) Error() string

func (SpecError) Unwrap

func (e SpecError) Unwrap() error

type SpecializeDef

type SpecializeDef struct {
	Ty  any
	C   any
	Cvs []any
}

type StructDef

type StructDef struct {
	Ty   any
	Opts []StructOpt
}

func Struct

func Struct[T any](opts ...StructOpt) StructDef

type StructOpt

type StructOpt interface {
	// contains filtered or unexported methods
}

type StructSpec

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

func NewStructSpec

func NewStructSpec(ty any, defs []StructDef) *StructSpec

func (StructSpec) Defs

func (ss StructSpec) Defs() []StructDef

func (StructSpec) Field

func (ss StructSpec) Field(name string) *FieldSpec

func (StructSpec) Fields

func (ss StructSpec) Fields() []*FieldSpec

func (StructSpec) Inits

func (ss StructSpec) Inits() []any

func (StructSpec) Meta

func (ss StructSpec) Meta() ctr.Map[reflect.Type, any]

func (StructSpec) Opts

func (ss StructSpec) Opts() []StructOpt

func (StructSpec) Receiver

func (ss StructSpec) Receiver() string

func (StructSpec) Type

func (ss StructSpec) Type() any

type TypeOpt

type TypeOpt struct {
	Ty any
}

func Type

func Type[T any]() TypeOpt

type WithInlineDef

type WithInlineDef struct {
	Fns []any
}

Directories

Path Synopsis
dev
gen

Jump to

Keyboard shortcuts

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