di

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoFurnisher      = errors.New("no furnisher in the current context")
	ErrUnsupportedType  = errors.New("type cannot be furnished")
	ErrTooManyFactories = errors.New("multiple factories located")
)

Functions

func Furnish

func Furnish(ctx context.Context, ref interface{}) error

func FurnishArgs

func FurnishArgs(ctx context.Context, fn reflect.Value) ([]reflect.Value, error)

func FurnishValue

func FurnishValue(ctx context.Context, ref reflect.Value) error

Types

type Configuration

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

Configuration is a builder for furnishers.

func (*Configuration) AddFactory

func (c *Configuration) AddFactory(creating reflect.Type, impl Factory)

func (*Configuration) Install

func (c *Configuration) Install(ctx context.Context) context.Context

type Factory

type Factory func(ctx context.Context) (reflect.Value, error)

Jump to

Keyboard shortcuts

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