Documentation
¶
Index ¶
Constants ¶
View Source
const ( CONFIG_AUTHENTICATION_URL = "auth_url" CONFIG_PRIVATEADR = "private_addr" )
View Source
const (
ConfigName string = "config::applicationconfig"
)
Variables ¶
View Source
var ( Version = "dev" // Set via -ldflags "-X main.Version=x.x.x" BuildTime = "unknown" // Set via -ldflags "-X main.BuildTime=..." GitCommit = "unknown" // Set via -ldflags "-X main.GitCommit=..." )
Version information - set at build time via ldflags
Functions ¶
func GetKeepFiles ¶ added in v1.0.12
func GetKeepFiles() int
GetKeepFiles returns the number of log files to keep
func GetLogLevel ¶ added in v1.0.12
func GetLogLevel() string
GetLogLevel returns the configured log level as a string
func GetLogLocation ¶ added in v1.0.12
func GetLogLocation() string
GetLogLocation returns the configured log file location
func GetServiceDirection ¶
GetServiceDirection returns the direction for a specific service by name
Types ¶
type AppConfig ¶
type AppConfig struct {
// contains filtered or unexported fields
}
func (*AppConfig) GetScopedDataConnection ¶
func (cfg *AppConfig) GetScopedDataConnection(name string) (DataConfig, error)
GetScopedDataConnection ...
func (*AppConfig) GetScopedDataConnectionbyType ¶
func (cfg *AppConfig) GetScopedDataConnectionbyType(t string) (DataConfig, error)
type DataConfig ¶
type DataConfig struct {
Name string `json:"name" fig:"name" default:"Connection"`
Scope []string `fig:"scope" default:"[default]"`
Type string `fig:"type"`
Hosts []string `fig:"hosts" default:"[localhost]"`
Port string `fig:"port"`
Database string `fig:"database" default:"dashs"`
ConnStr string `json:"-" fig:"connstr" default:""`
Username string `json:"-"`
Password string `json:"-"`
Cert string `fig:"cert"`
Key string `fig:"key"`
}
type LoggingConfig ¶ added in v1.0.12
type LoggingConfig struct {
KeepFiles int `json:"keep_files" fig:"keep_files" default:"5"`
Location string `json:"location" fig:"location" default:"./logs/app.log"`
LogLevel string `json:"loglevel" fig:"loglevel" default:"info"`
}
func GetLoggingConfig ¶ added in v1.0.12
func GetLoggingConfig() LoggingConfig
GetLoggingConfig returns the logging configuration
type ServiceConfig ¶
type ServiceConfig struct {
Name string `json:"name" fig:"name" default:"Service"`
Direction string `json:"direction" fig:"direction" default:"in"`
Type string `json:"type" fig:"type" default:"api"`
Scope string `json:"scope" fig:"scope" default:"DEV"`
Url string `json:"url" fig:"url" default:":8080"`
Port int `json:"port" fig:"port" default:"8080"`
Host string `json:"host" fig:"host" default:"localhost"`
MockUser string `json:"mockuser" fig:"mockuser" default:"mockuser@dashs.com"`
Connection string `json:"connection" fig:"connection" default:""`
}
func GetFirstServiceByDirection ¶
func GetFirstServiceByDirection(direction string) (*ServiceConfig, error)
GetFirstServiceByDirection returns the first service matching the specified direction
Click to show internal directories.
Click to hide internal directories.