diwrapper

package module
v0.0.0-...-42c26ab Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

Builder and initializer wrapper around Facwbook dependency injector

TODO

License

diwrapper is licensed under the Apache License, Version 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleaner

type Cleaner interface {
	Clean() error
}

Cleaners are called when everything ends, note that Stop() must be called explicitly.

type Initializer

type Initializer interface {
	Init() error
}

type InjectWrapper

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

func New

func New() *InjectWrapper

func NewDebug

func NewDebug() *InjectWrapper

NewDebug starts a diwrapper with debug output

func (*InjectWrapper) AllObjects

func (i *InjectWrapper) AllObjects() []interface{}

func (*InjectWrapper) CheckNoImplicitObjects

func (i *InjectWrapper) CheckNoImplicitObjects() *InjectWrapper

func (*InjectWrapper) InitializeGraph

func (i *InjectWrapper) InitializeGraph() *InjectWrapper

InitializeGraph initializes a graph, but fails if an object is not specified with one of the With() methods.

func (*InjectWrapper) InitializeGraphWithImplicitObjects

func (i *InjectWrapper) InitializeGraphWithImplicitObjects() *InjectWrapper

InitializeGraphWithImplicitObjects initializes a graph allowing implicitly created objects. Those are objects not specified with one of the With...() methods.

func (InjectWrapper) MustGetNamedObject

func (i InjectWrapper) MustGetNamedObject(sample interface{}, name string) interface{}

MustFindObject privides an object of the specified type and name (name can be empty for unnamed objects). Note that this function is only for debugging and testing. In production, objects should be used injected and never retrieved with this. That's why this method panics!

func (InjectWrapper) MustGetObject

func (i InjectWrapper) MustGetObject(sample interface{}) interface{}

MustGetObject: see MustGetNamedObject

func (*InjectWrapper) Stop

func (i *InjectWrapper) Stop(maxDuration time.Duration)

func (*InjectWrapper) Stopper

func (i *InjectWrapper) Stopper(maxDuration time.Duration) func()

func (*InjectWrapper) WithCleanBeforeShutdown

func (i *InjectWrapper) WithCleanBeforeShutdown(maxDuration time.Duration, sig ...os.Signal) *InjectWrapper

func (*InjectWrapper) WithNamedObject

func (i *InjectWrapper) WithNamedObject(name string, obj interface{}) *InjectWrapper

func (*InjectWrapper) WithObject

func (i *InjectWrapper) WithObject(object interface{}) *InjectWrapper

func (*InjectWrapper) WithObjectOrErr

func (i *InjectWrapper) WithObjectOrErr(object interface{}, err error) *InjectWrapper

WithObjectOrErr is a helper methods to be used with initializers which return a pointer and error

func (*InjectWrapper) WithObjects

func (i *InjectWrapper) WithObjects(objects ...interface{}) *InjectWrapper

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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