modules

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoggerModule = fx.Module("logger",
	fx.Provide(
		NewLogger,
	),
)
View Source
var TracerProviderModule = fx.Module("tracer_provider",
	fx.Provide(NewTracerProvider),
)

Functions

func GetFxTestOpts

func GetFxTestOpts(opts ...fx.Option) []fx.Option

func NewLogger

func NewLogger(cfg *config.Config) (*zap.Logger, error)

func NewTracerProvider

func NewTracerProvider(p TracingParams) (*tracesdk.TracerProvider, error)

NewTracerProvider returns an OpenTelemetry TracerProvider configured to use the configured exporter type that will send spans to the provided url. The returned TracerProvider will also use a Resource configured with all the information about the application.

func TestAudit

func TestAudit() audit.IAuditer

func TestConfig

func TestConfig() (*config.Config, error)

func TestDBClient

func TestDBClient() (*sql.DB, error)

func TestGRPCServer

func TestGRPCServer(ctx context.Context) (*grpc.ClientConn, func(p GRPCServerParams) (*grpc.Server, error), error)

func TestJetStreamClient

func TestJetStreamClient() (*events.JSWrapper, error)

func TestTokenMgr

func TestTokenMgr() *auth.TokenMgr

func TestUserInfoRetriever

func TestUserInfoRetriever() userinfo.UserInfoRetriever

Types

type GRPCServerParams

type GRPCServerParams struct {
	fx.In

	LC fx.Lifecycle

	Logger *zap.Logger

	GRPCAuth *auth.GRPCAuth
	GRPCPerm *auth.GRPCPerm

	Services []grpcsvc.Service `group:"grpcservices"`
}

type TracingParams

type TracingParams struct {
	fx.In

	LC fx.Lifecycle

	Config *config.Config
}

Jump to

Keyboard shortcuts

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