config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalMode = "local"
	ProdMode  = "prod"
)
View Source
const NumberOfUsersCmd = "number-users"
View Source
const ServerCmd = "server"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServerConfig        *ServerConfig        `arg:"subcommand:server"`
	NumberOfUsersConfig *NumberOfUsersConfig `arg:"subcommand:number-users"`
	AppMode             string               `arg:"-m,--app-mode,env:APP_MODE" default:"prod" help:"application mode [local,prod]"`
	RedisPort           string               `arg:"--redis-port,required,env:REDIS_PORT" placeholder:":6379"`
}

func ParseConfig

func ParseConfig() *Config

type Configure

type Configure interface {
	Config(fieldName string) string
	Command() string
}

type NumberOfUsersConfig

type NumberOfUsersConfig struct{}

func (*NumberOfUsersConfig) Command

func (c *NumberOfUsersConfig) Command() string

func (*NumberOfUsersConfig) Config

func (c *NumberOfUsersConfig) Config(fieldName string) (s string)

type ServerConfig

type ServerConfig struct {
	Port string `arg:"-p,--port,required,env:APP_PORT" placeholder:":8080"`
}

func (*ServerConfig) Command

func (c *ServerConfig) Command() string

func (*ServerConfig) Config

func (c *ServerConfig) Config(fieldName string) (s string)

Jump to

Keyboard shortcuts

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