component2

package
v0.28.20241212155801 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyPkgId = perrors.New("ErrEmptyPkgId")
	ErrRegistered = perrors.New("ErrRegistered")
	ErrGet        = perrors.New("ErrGet")
)

Functions

func Get

func Get[TargetInterface any](id string, prefunc ...PreFunc[TargetInterface]) (_interface TargetInterface)

func PkgId

func PkgId(varId ...string) string

func Register

func Register[TargetInterface any](id string, _interface TargetInterface) error

Types

type PreFunc added in v0.28.20241119180138

type PreFunc[TargetInterface any] interface {
	Init(TargetInterface) TargetInterface
	ErrNoFound(id string)
	ErrTypeAssertion(id string)
}

type PreFuncCu added in v0.28.20241119180138

type PreFuncCu[TargetInterface any] struct {
	Initf             func(TargetInterface) TargetInterface
	ErrNoFoundf       func(id string)
	ErrTypeAssertionf func(id string)
}

func (PreFuncCu[TargetInterface]) ErrNoFound added in v0.28.20241119180138

func (t PreFuncCu[TargetInterface]) ErrNoFound(id string)

func (PreFuncCu[TargetInterface]) ErrTypeAssertion added in v0.28.20241119180138

func (t PreFuncCu[TargetInterface]) ErrTypeAssertion(id string)

func (PreFuncCu[TargetInterface]) Init added in v0.28.20241119180138

func (t PreFuncCu[TargetInterface]) Init(s TargetInterface) TargetInterface

type PreFuncErr added in v0.28.20241119180138

type PreFuncErr[TargetInterface any] struct{}

func (PreFuncErr[TargetInterface]) ErrNoFound added in v0.28.20241119180138

func (PreFuncErr[TargetInterface]) ErrNoFound(id string)

func (PreFuncErr[TargetInterface]) ErrTypeAssertion added in v0.28.20241119180138

func (PreFuncErr[TargetInterface]) ErrTypeAssertion(id string)

func (PreFuncErr[TargetInterface]) Init added in v0.28.20241119180138

func (PreFuncErr[TargetInterface]) Init(s TargetInterface) TargetInterface

type PreFuncPanic added in v0.28.20241119180138

type PreFuncPanic[TargetInterface any] struct{}

func (PreFuncPanic[TargetInterface]) ErrNoFound added in v0.28.20241119180138

func (PreFuncPanic[TargetInterface]) ErrNoFound(id string)

func (PreFuncPanic[TargetInterface]) ErrTypeAssertion added in v0.28.20241119180138

func (PreFuncPanic[TargetInterface]) ErrTypeAssertion(id string)

func (PreFuncPanic[TargetInterface]) Init added in v0.28.20241119180138

func (PreFuncPanic[TargetInterface]) Init(s TargetInterface) TargetInterface

Jump to

Keyboard shortcuts

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