package server

import "fmt"

type Config struct {
	AppID        string
	AppName      string
	AppDomain    string
	PathPrefix   string
	NetAddr      string
	Port         int
	RegistryAddr string
	KVNamespace  string

	LoggerAddr       string `json:"logger_addr"`
	DbURL            string `json:"db_url"`
	CacheAddr        string `json:"cache_addr"`
	CachePassword    string `json:"cache_password"`
	MongoDbUrl       string `json:"mongodb_url"`
	EventBusURL      string `json:"eventbus_url"`
	EventBusExchange string `json:"eventbus_exchange"`
	EventBusQueue    string `json:"eventbus_queue"`
	HttpReadTimeout  int    `json:"http_read_timeout"`
	HttpWriteTimeout int    `json:"http_write_timeout"`
	HttpIdleTimeout  int    `json:"http_idle_timeout"`
	// Fields with json mapping are available trough ConsulKV
}

func (c *Config) GetAppFullName() string {
	return fmt.Sprintf("%s_%s", c.AppName, c.AppID)
}
