Documentation
¶
Overview ¶
Package infra provides infrastructure related utils to share among hipster shop services.
Index ¶
Constants ¶
View Source
const ( JaegerAddrEnv = "JAEGER_SERVICE_ADDR" DebugModeEnv = "ENABLE_DEBUG_MODE" AppPortEnv = "APP_PORT" )
environment variables
Variables ¶
View Source
var (
ErrNoEnv = errors.New("missing env variable")
)
exported errors
Functions ¶
func AppPort ¶ added in v0.2.1
AppPort gets the port from certain env variable if it is set, or use the provided port otherwise.
func InitJaegerTracing ¶
InitJaegerTracing init a jaeger exporter and register it. The agent endpoint comes from the env JAEGER_SERVICE_ADDR.
func InitLogrus ¶ added in v0.2.1
InitLogrus returns logger that prints to stderr. If ENABLE_DEBUG_MODE is set to "1", it outputs colored plain text for human read; otherwise it outputs JSON-formatted lines for machines parsing.
func WithHealth ¶ added in v0.2.1
WithHealth registers a health server.
func WithReflection ¶ added in v0.2.1
WithReflection turns on the server's reflection protocol.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.