config

package
v0.0.0-...-e5872de Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServiceName = "urls-top-words-counter"

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger  LoggerConfig
	General GeneralConfiguration
}

func HandleConfig

func HandleConfig(ctx context.Context) (*zap.SugaredLogger, *Config, error)

type GeneralConfiguration

type GeneralConfiguration struct {
	MaximumWorkersRequestsPerSecond int `env:"MAXIMUM_WORKERS_REQUESTS_SECONDS" default:"10"`
	WordsFileFullPath               string
	UrlsFileFullPath                string
	GetTopNWords                    int `env:"GET_TOP_N_WORDS" default:"10"`
	WorkersMultiplier               int `env:"WORKERS_MULTIPLIER" default:"1"` // The number of workers will be determined by the CPU cores. Setting this to more than one will allow more go-routines for each core
}

type LoggerConfig

type LoggerConfig struct {
	LogFormatting       string `env:"LOG_FORMATTING" default:"console"` //Modes: json, console (console is for development needs for nicer look on the console)
	LogPath             string `env:"LOG_PATH" default:"/var/logs"`
	LogEnableStdOutput  bool   `env:"LOG_ENABLE_STD_OUTPUT" default:"true"`
	LogEnableFileOutput bool   `env:"LOG_ENABLE_FILE_OUTPUT" default:"true"`
	LogLevel            string `env:"LOG_LEVEL" default:"info"`
}

Jump to

Keyboard shortcuts

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