container

package
v0.0.0-...-6b2826c Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: AGPL-3.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// KeyServiceContainer is the context key associated with the ServiceContainer value
	KeyServiceContainer goweb.ContextKey = "serviceContainer"
)

Variables

View Source
var ErrInvalidServiceContainer = errors.New("invalid service container")

ErrInvalidServiceContainer is returned when no service container could be found on the given context

Functions

func From

func From(ctx context.Context) (*service.Container, error)

From retrieves the service container from the given context

func Must

func Must(ctx context.Context) *service.Container

Must retrieves the service container from the given context or panics otherwise

func ServiceContainer

func ServiceContainer(container *service.Container) goweb.Middleware

ServiceContainer expose the given service container as a context value on the HTTP requests

func WithContainer

func WithContainer(ctx context.Context, container *service.Container) context.Context

WithContainer returns a new context.Context with the given *service.Container attached.

Types

This section is empty.

Jump to

Keyboard shortcuts

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