registry

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppRegistry

type AppRegistry struct {
	InterruptContext context.Context
	ShutdownContext  context.Context

	Config     *appconfig.AppConfig
	Dependency *DependencyRegistry
	Provider   *ProviderRegistry
	Repository *RepositoryRegistry
	Service    *ServiceRegistry
}

func NewAppRegistry

func NewAppRegistry(cfg *appconfig.AppConfig) *AppRegistry

type DependencyRegistry

type DependencyRegistry struct {
	// register your dependency on here
	ZeroLogDefaultFields map[string]any
	LumberjackLogger     *lumberjack.Logger
	ZeroLogger           zerolog.Logger

	OtelModule                   string
	OtelGrpcConn                 *grpc.ClientConn
	OtelResource                 *resource.Resource
	OtelShutdownTracerProviderFn func(context.Context) error
	OtelShutdownMeterProviderFn  func(context.Context) error
	Tracer                       trace.Tracer
	Metric                       metric.Meter

	Storage           xlazy.Loader[*minio.Client]
	MySqlDB           xlazy.Loader[*sqlx.DB]
	Redis             xlazy.Loader[*redis.Client]
	NatsConn          xlazy.Loader[*nats.Conn]
	NatsJetStreamConn xlazy.Loader[jetstream.JetStream]
}

func NewDependencyRegistry

func NewDependencyRegistry() *DependencyRegistry

type ProviderRegistry

type ProviderRegistry struct{}

func NewProviderRegistry

func NewProviderRegistry() *ProviderRegistry

type RepositoryRegistry

type RepositoryRegistry struct {
	// register your repository on here
	User repo_api.UserRepoAPI
}

func NewRepositoryRegistry

func NewRepositoryRegistry() *RepositoryRegistry

type ServiceRegistry

type ServiceRegistry struct {
	// register your service on here
	User service_api.UserServiceAPI
}

func NewServiceRegistry

func NewServiceRegistry() *ServiceRegistry

Jump to

Keyboard shortcuts

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