ioc

package
v0.0.0-...-614ca16 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustProvide

func MustProvide(provider Provider, target interface{}, options ...Options)

Types

type Container

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

func NewContainer

func NewContainer() *Container

func (*Container) BindFactory

func (c *Container) BindFactory(factory interface{}, options ...Options)

func (*Container) BindSingleton

func (c *Container) BindSingleton(instance interface{}, options ...Options)

func (*Container) Provide

func (c *Container) Provide(target interface{}, options ...Options) error

func (Container) String

func (c Container) String() string

type Options

type Options struct {
	Name string
	// contains filtered or unexported fields
}

func Option

func Option() Options

func (Options) ProvidingTypes

func (o Options) ProvidingTypes(types ...interface{}) Options

func (Options) String

func (o Options) String() string

func (Options) WithName

func (o Options) WithName(name string) Options

type Provider

type Provider interface {
	Provide(instance interface{}, options ...Options) error
}

Jump to

Keyboard shortcuts

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