parent
5df56dfc0e
commit
4579ca4e2f
|
@ -7,28 +7,37 @@ import (
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Worker is a struct
|
// Worker describes how many service workers to launch
|
||||||
type Worker struct {
|
type Worker struct {
|
||||||
ChannelSize int64 `mapstructure:"channel_size,omitempty"`
|
Count int32 `mapstructure:"count,omitempty"`
|
||||||
WorkerCount int `mapstructure:"worker_count,omitempty"`
|
Method string `mapstructure:"method,omitempty"`
|
||||||
|
Struct string `mapstructure:"struct,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type metrics struct {
|
// CacheSize describes how to chunkify resources
|
||||||
|
type CacheSize struct {
|
||||||
|
Increment int64
|
||||||
|
}
|
||||||
|
|
||||||
|
// Metrics defines the if and where to collect data
|
||||||
|
type Metrics struct {
|
||||||
Address string `mapstructure:"address,omitempty"`
|
Address string `mapstructure:"address,omitempty"`
|
||||||
Enabled bool `mapstructure:"enabled,omitempty"`
|
Enabled bool `mapstructure:"enabled,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type endpoint struct {
|
// Endpoint describes a web URL as a service endpoint
|
||||||
|
type Endpoint struct {
|
||||||
BasePath string `mapstructure:"base_path,omitempty"`
|
BasePath string `mapstructure:"base_path,omitempty"`
|
||||||
Host string `mapstructure:"host,omitempty"`
|
Host string `mapstructure:"host,omitempty"`
|
||||||
Scheme string `mapstructure:"scheme,omitempty"`
|
Scheme string `mapstructure:"scheme,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type chunk struct {
|
// Chunk defines cache chunk size
|
||||||
|
type Chunk struct {
|
||||||
size int32 `mapstructure:"size,omitempty"`
|
size int32 `mapstructure:"size,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceAccount is a struct
|
// ServiceAccount defines and external service
|
||||||
type ServiceAccount struct {
|
type ServiceAccount struct {
|
||||||
APIKey string `mapstructure:"api_key,omitempty"`
|
APIKey string `mapstructure:"api_key,omitempty"`
|
||||||
ApplicationName string `mapstructure:"application_name,omitempty"`
|
ApplicationName string `mapstructure:"application_name,omitempty"`
|
||||||
|
@ -37,7 +46,7 @@ type ServiceAccount struct {
|
||||||
ClientID string `mapstructure:"client_id,omitempty"`
|
ClientID string `mapstructure:"client_id,omitempty"`
|
||||||
ClientSecret string `mapstructure:"client_secret,omitempty"`
|
ClientSecret string `mapstructure:"client_secret,omitempty"`
|
||||||
DSN string `mapstructure:"dsn,omitempty"`
|
DSN string `mapstructure:"dsn,omitempty"`
|
||||||
Endpoint endpoint `mapstructure:"endpoint,omitempty"`
|
Endpoint Endpoint `mapstructure:"endpoint,omitempty"`
|
||||||
Password string `mapstructure:"password,omitempty"`
|
Password string `mapstructure:"password,omitempty"`
|
||||||
Production bool `mapstructure:"production,omitempty"`
|
Production bool `mapstructure:"production,omitempty"`
|
||||||
SecurityToken string `mapstructure:"security_token,omitempty"`
|
SecurityToken string `mapstructure:"security_token,omitempty"`
|
||||||
|
@ -48,24 +57,25 @@ type ServiceAccount struct {
|
||||||
Vendor string `mapstructure:"vendor,omitempty"`
|
Vendor string `mapstructure:"vendor,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type configuration struct {
|
// Configuration defines the config struct
|
||||||
|
type Configuration struct {
|
||||||
AppName string `mapstructure:"app_name,omitempty"`
|
AppName string `mapstructure:"app_name,omitempty"`
|
||||||
BackendID string `mapstructure:"backend_id,omitempty"`
|
BackendID string `mapstructure:"backend_id,omitempty"`
|
||||||
BuildEnv string `mapstructure:"build_env,omitempty"`
|
BuildEnv string `mapstructure:"build_env,omitempty"`
|
||||||
ClusterID string `mapstructure:"cluster_id,omitempty"`
|
ClusterID string `mapstructure:"cluster_id,omitempty"`
|
||||||
Chunks map[string]chunk `mapstructure:"chunks,omitempty"`
|
Chunks map[string]Chunk `mapstructure:"chunks,omitempty"`
|
||||||
DBMS string `mapstructure:"dbms,omitempty"`
|
DBMS string `mapstructure:"dbms,omitempty"`
|
||||||
DBMSHost string `mapstructure:"dbms_host,omitempty"`
|
DBMSHost string `mapstructure:"dbms_host,omitempty"`
|
||||||
DBMSName string `mapstructure:"dbms_name,omitempty"`
|
DBMSName string `mapstructure:"dbms_name,omitempty"`
|
||||||
DBMSPassword string `mapstructure:"dbms_password,omitempty"`
|
DBMSPassword string `mapstructure:"dbms_password,omitempty"`
|
||||||
DBMSUsername string `mapstructure:"dbms_username,omitempty"`
|
DBMSUsername string `mapstructure:"dbms_username,omitempty"`
|
||||||
DSN string `mapstructure:"dsn,omitempty"`
|
DSN string `mapstructure:"dsn,omitempty"`
|
||||||
Endpoint endpoint `mapstructure:"endpoint,omitempty"`
|
Endpoint Endpoint `mapstructure:"endpoint,omitempty"`
|
||||||
Environment string `mapstructure:"environment,omitempty"`
|
Environment string `mapstructure:"environment,omitempty"`
|
||||||
GelfURI string `mapstructure:"gelf_uri,omitempty"`
|
GelfURI string `mapstructure:"gelf_uri,omitempty"`
|
||||||
GitHubOrgName string `mapstructure:"git_hub_org_name,omitempty"`
|
GitHubOrgName string `mapstructure:"git_hub_org_name,omitempty"`
|
||||||
LogLevel int `mapstructure:"log_level,omitempty"`
|
LogLevel int `mapstructure:"log_level,omitempty"`
|
||||||
Metrics metrics `mapstructure:"metrics,omitempty"`
|
Metrics Metrics `mapstructure:"metrics,omitempty"`
|
||||||
KafkaServer string `mapstructure:"kafka_server,omitempty"`
|
KafkaServer string `mapstructure:"kafka_server,omitempty"`
|
||||||
PDFRenderEngine string `mapstructure:"pdf_render_engine,omitempty"`
|
PDFRenderEngine string `mapstructure:"pdf_render_engine,omitempty"`
|
||||||
RegistryPriv string `mapstructure:"registry_priv,omitempty"`
|
RegistryPriv string `mapstructure:"registry_priv,omitempty"`
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var sugar *zap.SugaredLogger
|
var sugar *zap.SugaredLogger
|
||||||
var config = configuration{}
|
var config = Configuration{}
|
||||||
var appViper = viper.New()
|
var appViper = viper.New()
|
||||||
|
|
||||||
// const dateTimeFormat = "2006-01-02T15:04:05-0800"
|
// const dateTimeFormat = "2006-01-02T15:04:05-0800"
|
||||||
|
|
Loading…
Reference in New Issue