model

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxKeyCmd              = contextKey("command")
	CtxKeyHttpServerRunner = contextKey("HttpServerController")
	CtxKeyBuildInfo        = contextKey("BuildInfo")
	CtxKeyServerConfig     = contextKey("ServerConfig")
	CtxKeyTestConfig       = contextKey("TestConfig")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo interface {
	Version() string
	BuildTime() string
	AppName() string
	ModulePath() string
}

type HttpServicer

type HttpServicer interface {
	// Name returns the name of the service
	Name() string
	// Prepare prepares the service for running, for example by registering HTTP routes, allocating resources, checking network dependencies, etc.
	Prepare(ctx context.Context, serverConfig configs.ServerConfiger, testConfig configs.TestConfiger, httpRouter chi.Router, tr trace.Tracer) error
	// Run runs the service. Called after all services have been prepared.
	Start(ctx context.Context) error
	// Stop stops the service. Called when the application is shutting down. It should free resources, close connections, etc.
	Stop(ctx context.Context) error
}

HttpServicer is the interface for HTTP services

Jump to

Keyboard shortcuts

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