initializers

package
v0.0.0-...-7fde5c4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 13 Imported by: 0

README

Initializers

Documentation

Index

Constants

View Source
const (
	// HTTPServerAddrEnv is an environment variable name for HTTP server address
	HTTPServerAddrEnv = "HTTP_SERVER_ADDR"
	// DefaultHTTPServerAddr  is a default value for HTTP server address
	DefaultHTTPServerAddr = ":8000"
)
View Source
const (
	// LogLevelEnv is an environment variable name for LOG_LEVEL
	LogLevelEnv = "LOG_LEVEL"
	// EnableJSONLogsEnv is an environment variable name for ENABLE_JSON_LOGS
	EnableJSONLogsEnv = "ENABLE_JSON_LOGS"
	// DefaultLogLevel is a default LOG_LEVEL value
	DefaultLogLevel = 0
)

Variables

This section is empty.

Functions

func InitializeBuildInfo

func InitializeBuildInfo() *build.Info

InitializeBuildInfo creates new build.Info

func InitializeEnvs

func InitializeEnvs()

InitializeEnvs intializes envy

func InitializeHTTPServer

func InitializeHTTPServer(cfg *HTTPServerConfig) (*http.Server, error)

InitializeHTTPServer create new http.Server instance

func InitializeLogs

func InitializeLogs() error

InitializeLogs setups zerolog logger

func InitializeRouter

func InitializeRouter(container *dependencies.Container) *gin.Engine

InitializeRouter initializes new gin router

Types

type HTTPServerAddr

type HTTPServerAddr string

HTTPServerAddr is a type alias for HTTP server address values

type HTTPServerConfig

type HTTPServerConfig struct {
	HTTPServerAddr HTTPServerAddr
	Router         *gin.Engine
}

HTTPServerConfig is a type to store HTTP server config

func InitializeHTTPServerConfig

func InitializeHTTPServerConfig(router *gin.Engine) *HTTPServerConfig

InitializeHTTPServerConfig initializes new config for InitializeHTTPServer

Jump to

Keyboard shortcuts

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