foundation

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 5 Imported by: 0

README

foundation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {

	// Indicates if the application has been bootstrapped before.
	HasBeenBootstrapped bool
	// contains filtered or unexported fields
}

func (*Application) BindPathsInContainer

func (a *Application) BindPathsInContainer(path inter.BasePath)

Bind all of the application paths in the container.

func (*Application) Container

func (a *Application) Container() *Container

Get the service container

func (*Application) Environment

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

func (*Application) IsEnvironment

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

func (Application) Make

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

Resolve the given type from the container.

func (*Application) SetContainer

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

Set the service 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) Bound

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

Determine if the given abstract type has been bound.

func (Container) Copy

func (c Container) Copy() *Container

func (*Container) Extend

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

"Extend" an abstract type in the container.

func (*Container) GetBindings added in v0.1.0

func (c *Container) GetBindings() bindings

Get the container's bindings.

func (*Container) Instance

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

Register an existing instance as shared in the container.

func (*Container) IsAlias

func (c *Container) IsAlias(name string) bool

Determine if a given string is an alias.

func (*Container) JustBind added in v0.2.0

func (c *Container) JustBind(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{}

Resolve 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

Jump to

Keyboard shortcuts

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