flags

package
v0.0.0-...-cd6a17b Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIGS_FLAG                  = "configs"
	CERTS_FLAG                    = "certs"
	LOGGER_OUTPUT_PATH_FLAG       = "logger-output-path"
	LOGGER_ERROR_OUTPUT_PATH_FLAG = "logger-error-output-path"
	LOCALES_PATH_FLAG             = "locales_path"
	LOCALES_PATH                  = "locales"

	CONFIGS_PATH_DEFAULT             = "configs"
	CERTS_PATH_DEFAULT               = "certs"
	LOGGER_OUTPUT_PATH_DEFAULT       = "logs/output.log"
	LOGGER_ERROR_OUTPUT_PATH_DEFAULT = "logs/error.log"
	LOCALES_PATH_DEFAULT             = "locales"
)
View Source
const APP_MODE_FLAG = "mode"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppMode

type AppMode string
const (
	AppModeDev  AppMode = "dev"
	AppModeProd AppMode = "prod"
)

type FlagsConfig

type FlagsConfig struct {
	Mode        AppMode
	ConfigsPath string
	CertsPath   string
	Logger      FlagsLoggerConfig
	LocalesPath string
	Locales     Locales
}

func SetupFlags

func SetupFlags(parsedFlags *ParsedFlags) *FlagsConfig

type FlagsLoggerConfig

type FlagsLoggerConfig struct {
	OutputPath      string
	ErrorOutputPath string
}

type Locales

type Locales []language.Tag

func (*Locales) Set

func (l *Locales) Set(value string) error

func (Locales) String

func (l Locales) String() string

type ParsedFlags

type ParsedFlags struct {
	AppMode               *string
	ConfigsPath           *string
	CertsPath             *string
	LoggerOutputPath      *string
	LoggerErrorOutputPath *string
	LocalesPath           *string
	Locales               *Locales
}

func ParseFlags

func ParseFlags() *ParsedFlags

Jump to

Keyboard shortcuts

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