dikit

package
v0.0.0-...-ba7efc3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dikit do

Index

Constants

This section is empty.

Variables

View Source
var ErrFactoryNotFound = errors.Sentinel("factory not found")

Functions

func Add

func Add[T any](c *Container, name string, b Builder[T]) error

func AddValue

func AddValue[T any](c *Container, name string, value T) error

func Close

func Close(c *Container, name string) error

func Find

func Find[T any](c *Container, fn func(string) bool) ([]T, error)

func Get

func Get[T any](c *Container, name string) (T, error)

Types

type Builder

type Builder[T any] func(*Container) (T, error)

type Container

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

func NewContainer

func NewContainer() *Container

func (*Container) Close

func (c *Container) Close() error

Jump to

Keyboard shortcuts

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