Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultWebAddress is the default address the service look for the database DefaultDBHost = "localhost" // DefaultDBPort is the default port the service connect to the database DefaultDBPort = 5432 // DefaultDBUser is the default user the service will try for the database DefaultDBUser = "postgres" // DefaultDBPassword is the default password the service will try for the database DefaultDBPassword = "postgres" // DefaultDBName is the default dbname the service connect to the database DefaultDBName = "caputo" )
db defaults
View Source
const ( // DefaultWebAddress is the default address the service will bind to DefaultWebAddress = "0.0.0.0" // DefaultWebPort is the default port the service will listen on DefaultWebPort = 8080 )
web defaults
View Source
const (
DefaultStoragePath = "uploaded"
)
storage defaults
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Web is the configuration for the web listener Web *WebConfig `yaml:"web"` // DB is the configuration for the db connection DB *DBConfig `yaml:"db"` // Storage is the configuration for file storage Storage *StorageConfig `yaml:"storage"` // Meta contains meta information about the config // it isn't specified in the user config Meta *MetaConfig }
Config is the main configuration structure
type DBConfig ¶
type DBConfig struct { Host string `yaml:"host"` Port int `yaml:"port"` User string `yaml:"user"` Password string `yaml:"password"` Name string `yaml:"dbname"` }
DBConfig is the structure which supports the configuration of the database
type MetaConfig ¶
type MetaConfig struct { CommitHash string BuildDate string // contains filtered or unexported fields }
MetaConfig is the automatically filled meta information about the config
type StorageConfig ¶
type StorageConfig struct {
Path string `yaml:"path"`
}
type WebConfig ¶
type WebConfig struct { // Address to listen on (defaults to 0.0.0.0 specified by DefaultWebAddress) Address string `yaml:"address"` // Port to listen on (default to 8080 specified by DefaultWebPort) Port int `yaml:"port"` }
WebConfig is the structure which supports the configuration of the endpoint which provides access to the web frontend
func (*WebConfig) SocketAddress ¶
SocketAddress returns the combination of the Address and the Port
Click to show internal directories.
Click to hide internal directories.