Help us shape the future of Go! Take the 2026 Go Developer Survey

service

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: GPL-2.0 Imports: 4 Imported by: 157

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 ExtendContext added in v0.8.7

func ExtendContext(ctx context.Context) 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
	Clone() Registry
}

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