foundation

package module
v0.5.0-beta Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT Imports: 6 Imported by: 2

README

Foundation

This repository contains the foundation for confetti.

https://confetti-framework.github.io/docs/docs/architecture-concepts/lifecycle.html

License

Confetti is open-sourced software licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CanNotInstantiateCallbackWithParameters = errors.New("Can not instantiate callback with parameters")

Functions

func NewContainerByBoot added in v0.3.1

func NewContainerByBoot(bootContainer inter.Container) inter.Container

func NewTestApp added in v0.5.1

func NewTestApp(decorator func(container inter.Container) inter.Container) inter.App

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

Container fetch the container from the application

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.LoggerFacade

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.

Jump to

Keyboard shortcuts

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