30 lines
549 B
Go
30 lines
549 B
Go
package config
|
|
|
|
// Configuration
|
|
type Config struct {
|
|
Server *Server
|
|
Database *Database
|
|
Log *Log
|
|
}
|
|
|
|
// Server configuration
|
|
type Server struct {
|
|
Address string `toml:"address"`
|
|
ReadTimeout int `toml:"read_timeout"`
|
|
WriteTimeout int `toml:"write_timeout"`
|
|
}
|
|
|
|
// Database configuration
|
|
type Database struct {
|
|
Driver string `toml:"driver"`
|
|
URL string `toml:"url"`
|
|
SSL bool `toml:"ssl"`
|
|
Max int `toml:"max"`
|
|
Idle int `toml:"idle"`
|
|
}
|
|
|
|
// Log configuration
|
|
type Log struct {
|
|
Level string `toml:"level"`
|
|
}
|