foundation

package module
v0.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 6 Imported by: 2

README

foundation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContainerByBoot added in v0.3.1

func NewContainerByBoot(bootContainer inter.Container) inter.Container

Types

type Application

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

func NewApp added in v0.3.1

func NewApp() *Application

func (*Application) Bind added in v0.3.1

func (a *Application) Bind(abstract interface{}, concrete interface{})

func (*Application) Container

func (a *Application) Container() *inter.Container

GetE the service container

func (*Application) Environment added in v0.3.1

func (a *Application) Environment() (string, error)

func (*Application) Instance added in v0.3.1

func (a *Application) Instance(abstract interface{}) interface{}

func (*Application) IsEnvironment added in v0.3.1

func (a *Application) IsEnvironment(environments ...string) bool

func (*Application) Log added in v0.3.1

func (a *Application) Log(channels ...string) inter.Logger

func (*Application) Make

func (a *Application) Make(abstract interface{}) interface{}

Make the given type from the container.

func (*Application) MakeE added in v0.3.1

func (a *Application) MakeE(abstract interface{}) (interface{}, error)

Make or give an error by the given type from the container.

func (*Application) SetContainer added in v0.3.1

func (a *Application) SetContainer(container inter.Container)

Set the service container

func (*Application) Singleton added in v0.3.1

func (a *Application) Singleton(abstract interface{}, concrete interface{})

Register a shared binding in the container.

type Container

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

func NewContainer

func NewContainer() *Container

func (*Container) Bind

func (c *Container) Bind(abstract interface{}, concrete interface{})

Register a binding with the container.

func (*Container) Bindings added in v0.3.1

func (c *Container) Bindings() inter.Bindings

GetE the container's bindings.

func (*Container) Bound

func (c *Container) Bound(abstract string) bool

Determine if the given abstract type has been bound.

func (*Container) Extend added in v0.3.1

func (c *Container) Extend(abstract interface{}, function func(service interface{}) interface{})

"Extend" an abstract type in the container.

func (*Container) Instance

func (c *Container) Instance(concrete interface{}) interface{}

Register an existing instance as shared in the container without an abstract

func (*Container) Make

func (c *Container) Make(abstract interface{}) interface{}

MakeE the given type from the container.

func (*Container) MakeE added in v0.3.1

func (c *Container) MakeE(abstract interface{}) (interface{}, error)

MakeE the given type from the container.

func (*Container) Singleton

func (c *Container) Singleton(abstract interface{}, concrete interface{})

Register a shared binding in the container.

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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