service

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: GPL-2.0 Imports: 3 Imported by: 41

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWith

func ContextWith[T any](ctx context.Context, service T) context.Context

func ContextWithDefaultRegistry added in v0.2.5

func ContextWithDefaultRegistry(ctx context.Context) context.Context

func ContextWithPtr

func ContextWithPtr[T any](ctx context.Context, servicePtr *T) context.Context

func ContextWithRegistry

func ContextWithRegistry(ctx context.Context, registry Registry) context.Context

func FromContext

func FromContext[T any](ctx context.Context) T

func MustRegister added in v0.2.11

func MustRegister[T any](ctx context.Context, service T)

func MustRegisterPtr added in v0.2.11

func MustRegisterPtr[T any](ctx context.Context, servicePtr *T)

func PtrFromContext

func PtrFromContext[T any](ctx context.Context) *T

Types

type Registry

type Registry interface {
	Register(serviceType any, service any) any
	Get(serviceType any) any
}

func NewRegistry

func NewRegistry() Registry

func RegistryFromContext

func RegistryFromContext(ctx context.Context) Registry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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