golazy.dev golazy.dev / lazydeps Index | Files

package lazydeps

import "golazy.dev/lazydeps"

Package lazydeps records application dependency initialization and the dependency graph between services.

Applications receive a *Scope from lazyapp.Config.Dependencies and initialize shared services with Service. Service returns a typed Ref; calling Ref.Use inside another service initializer records that dependency edge and returns the wrapped service value.

Types

type Edge

type Edge struct {
	From	string
	To	string
}

type Func

type Func[T any] func(context.Context) (context.Context, T, error, context.CancelFunc)