Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultConfigFile is the default configuration file. DefaultConfigFile = "./config/config.yaml" // DefaultHost is the default host DefaultHost = "localhost" // DefaultPort is the default port to run the server on. DefaultPort = "8080" // DefaultPrivateKey is the default private key to use for signing tokens. DefaultPrivateKey = "./config/private.pem" // DefaultPublicKey is the default public key to use for verifying tokens. DefaultPublicKey = "./config/public.pem" )
View Source
const ( // DefaultDBDriver is the default database driver. DefaultDBDriver = "sqlite" // DefaultDBHost is the default database host. DefaultDBHost = "" // DefaultDBPort is the default database port. DefaultDBPort = "" // DefaultDBUser is the default database user. DefaultDBUser = "" // DefaultDBPassword is the default database password. DefaultDBPassword = "" // DefaultDBName is the default database name. DefaultDBName = "./config/sqlite.db" )
View Source
const (
// AvailableDatabaseDrivers is a list of available database drivers.
AvailableDatabaseDrivers = "postgres,sqlite"
)
Variables ¶
This section is empty.
Functions ¶
func GetExecutablePath ¶
GetExecutablePath returns the absolute path of the executable
func RelativePath ¶
RelativePath returns the absolute path of a relative path.
Types ¶
type Config ¶
type Database ¶
type Database struct { Type string `yaml:"type" json:"type" env:"DB_TYPE"` Host string `yaml:"host,omitempty" json:"host,omitempty" env:"DB_HOST"` Port string `yaml:"port,omitempty" json:"port,omitempty" env:"DB_PORT"` Username string `yaml:"user,omitempty" json:"user,omitempty" env:"DB_USER"` Password string `yaml:"pass,omitempty" json:"pass,omitempty" env:"DB_PASS"` Name string `yaml:"name,omitempty" json:"name,omitempty" env:"DB_NAME"` }
type Server ¶
type Server struct { Host string `yaml:"host,omitempty" json:"host,omitempty" env:"HOST"` Port string `yaml:"port,omitempty" json:"port,omitempty" env:"PORT"` PrivateKey string `yaml:"private_key" json:"private_key" env:"PRIVATE_KEY"` PublicKey string `yaml:"public_key" json:"public_key" env:"PUBLIC_KEY"` }
Click to show internal directories.
Click to hide internal directories.