dix_inter

package
v0.3.17 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// InjectMethodPrefix 可以对对象进行 Inject, 只要这个对象的方法中包含了以`InjectMethodPrefix`为前缀的方法
	InjectMethodPrefix = "DixInject"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dix

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

func New

func New(opts ...Option) *Dix

New Dix new

func (*Dix) Graph

func (x *Dix) Graph() *Graph

func (*Dix) Inject

func (x *Dix) Inject(param any, opts ...Option) any

func (*Dix) Option

func (x *Dix) Option() Options

func (*Dix) Provide

func (x *Dix) Provide(param any)

type Graph

type Graph struct {
	Objects   string `json:"objects"`
	Providers string `json:"providers"`
}

type Option

type Option func(opts *Options)

func WithValuesNull

func WithValuesNull() Option

type Options

type Options struct {
	// 允许结果为nil
	AllowValuesNull bool
}

func (Options) Check

func (o Options) Check()

func (Options) Merge

func (o Options) Merge(opt Options) Options

Jump to

Keyboard shortcuts

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