container

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ScopeIDKey = struct{}{}

ScopeIDKey is the key used to store the scope ID in the context

Functions

This section is empty.

Types

type Container

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

func NewContainer

func NewContainer() *Container

func (*Container) BeginScope

func (c *Container) BeginScope(scopeID string)

func (*Container) Bind

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

func (*Container) EndScope

func (c *Container) EndScope(scopeID string)

func (*Container) Resolve

func (c *Container) Resolve(out interface{}) error

func (*Container) ResolveCtx

func (c *Container) ResolveCtx(ctx context.Context, out interface{}) error

func (*Container) Scoped

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

func (*Container) Singleton

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

type ServiceContainer

type ServiceContainer interface {
	Bind(abstract interface{}, concrete interface{})
	Singleton(abstract interface{}, concrete interface{})
	Scoped(abstract interface{}, concrete interface{})
	Resolve(out interface{}) error
	ResolveCtx(ctx context.Context, out interface{}) error
	BeginScope(scopeID string)
	EndScope(scopeID string)
}

Jump to

Keyboard shortcuts

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