server

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTPServerModule = fx.Module("httpserver",
	fx.Provide(
		NewHTTP,
	),
	fx.Decorate(wrapLogger),
)
View Source
var TracerProviderModule = fx.Module("tracerProvider",
	fx.Provide(NewTracerProvider),
)

Functions

func NewTracerProvider

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

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

Types

type ServerParams

type ServerParams struct {
	fx.In

	LC fx.Lifecycle

	Logger   *zap.Logger
	Config   *config.Config
	DB       *sql.DB
	TP       *tracesdk.TracerProvider
	TokenMgr *auth.TokenMgr
}

type ServerResult

type ServerResult struct {
	fx.Out

	Server *http.Server
}

func NewHTTP

func NewHTTP(p ServerParams) (ServerResult, error)

NewHTTP builds an HTTP server that will begin serving requests when the Fx application starts.

type TracingParams

type TracingParams struct {
	fx.In

	LC fx.Lifecycle

	Config *config.Config
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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