extension

package module
v0.0.0-...-5c387ec Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SimpleType

func SimpleType(typ reflect.Type) reflect.Type

SimpleType returns a simple type, it unwraps pointer, slice, array, and chan

Types

type Listener

type Listener func(t *Type)

Listener represents a listener

type Option

type Option func(t *Type)

Option represent type option

func WithForceFlag

func WithForceFlag() Option

WithForceFlag will force the type to be generated

func WithName

func WithName(name string) Option

WithName is an option to set the name of the type

func WithPackage

func WithPackage(pkg string) Option

WithPackage is an option to set the package name of the type

func WithScn

func WithScn(at int) Option

WithScn is an option to set the scn(sequence change number) of the type

type Registry

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

Registry represents an extension type

func NewRegistry

func NewRegistry(options ...RegistryOption) *Registry

NewRegistry creates a registry

func (*Registry) Lookup

func (r *Registry) Lookup(name string) *Type

Lookup returns a type by name

func (*Registry) Merge

func (r *Registry) Merge(registry *Registry)

Merge merges registry

func (*Registry) Register

func (r *Registry) Register(aType *Type)

Register registers a type

func (*Registry) Scn

func (r *Registry) Scn() int

Scn returns registry sequence change number

type RegistryOption

type RegistryOption func(r *Registry)

RegistryOption represent registry option

func WithListener

func WithListener(listener Listener) RegistryOption

WithListener creates a new registry with the specified listener

func WithRegistryScn

func WithRegistryScn(scn int) RegistryOption

WithRegistryScn is an option to set scn time

type Type

type Type struct {
	Type    reflect.Type
	Package string
	Name    string
	Scn     int
	Force   bool
	// contains filtered or unexported fields
}

Type represents a type

func NewType

func NewType(t reflect.Type, options ...Option) *Type

NewType creates a type

func (*Type) IsNamed

func (t *Type) IsNamed() bool

IsNamed returns true if type is named

func (*Type) Key

func (t *Type) Key() string

Jump to

Keyboard shortcuts

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