diff options
Diffstat (limited to 'forged/internal/config')
| -rw-r--r-- | forged/internal/config/config.go | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/forged/internal/config/config.go b/forged/internal/config/config.go index 1825882..414a811 100644 --- a/forged/internal/config/config.go +++ b/forged/internal/config/config.go @@ -10,79 +10,79 @@ import ( ) type Config struct { - DB DB `scfg:"db"` - Web Web `scfg:"web"` - Hooks Hooks `scfg:"hooks"` - LMTP LMTP `scfg:"lmtp"` - SSH SSH `scfg:"ssh"` - IRC IRC `scfg:"irc"` - Git Git `scfg:"git"` - General General `scfg:"general"` - Pprof Pprof `scfg:"pprof"` + DB DB `scfgs:"db"` + Web Web `scfgs:"web"` + Hooks Hooks `scfgs:"hooks"` + LMTP LMTP `scfgs:"lmtp"` + SSH SSH `scfgs:"ssh"` + IRC IRC `scfgs:"irc"` + Git Git `scfgs:"git"` + General General `scfgs:"general"` + Pprof Pprof `scfgs:"pprof"` } type DB struct { - Conn string `scfg:"conn"` + Conn string `scfgs:"conn"` } type Web struct { - Net string `scfg:"net"` - Addr string `scfg:"addr"` - Root string `scfg:"root"` - CookieExpiry int `scfg:"cookie_expiry"` - ReadTimeout uint32 `scfg:"read_timeout"` - WriteTimeout uint32 `scfg:"write_timeout"` - IdleTimeout uint32 `scfg:"idle_timeout"` - MaxHeaderBytes int `scfg:"max_header_bytes"` - ReverseProxy bool `scfg:"reverse_proxy"` - ShutdownTimeout uint32 `scfg:"shutdown_timeout"` - TemplatesPath string `scfg:"templates_path"` - StaticPath string `scfg:"static_path"` + Net string `scfgs:"net"` + Addr string `scfgs:"addr"` + Root string `scfgs:"root"` + CookieExpiry int `scfgs:"cookie_expiry"` + ReadTimeout uint32 `scfgs:"read_timeout"` + WriteTimeout uint32 `scfgs:"write_timeout"` + IdleTimeout uint32 `scfgs:"idle_timeout"` + MaxHeaderBytes int `scfgs:"max_header_bytes"` + ReverseProxy bool `scfgs:"reverse_proxy"` + ShutdownTimeout uint32 `scfgs:"shutdown_timeout"` + TemplatesPath string `scfgs:"templates_path"` + StaticPath string `scfgs:"static_path"` } type Hooks struct { - Socket string `scfg:"socket"` - Execs string `scfg:"execs"` + Socket string `scfgs:"socket"` + Execs string `scfgs:"execs"` } type LMTP struct { - Socket string `scfg:"socket"` - Domain string `scfg:"domain"` - MaxSize int64 `scfg:"max_size"` - WriteTimeout uint32 `scfg:"write_timeout"` - ReadTimeout uint32 `scfg:"read_timeout"` + Socket string `scfgs:"socket"` + Domain string `scfgs:"domain"` + MaxSize int64 `scfgs:"max_size"` + WriteTimeout uint32 `scfgs:"write_timeout"` + ReadTimeout uint32 `scfgs:"read_timeout"` } type SSH struct { - Net string `scfg:"net"` - Addr string `scfg:"addr"` - Key string `scfg:"key"` - Root string `scfg:"root"` - ShutdownTimeout uint32 `scfg:"shutdown_timeout"` + Net string `scfgs:"net"` + Addr string `scfgs:"addr"` + Key string `scfgs:"key"` + Root string `scfgs:"root"` + ShutdownTimeout uint32 `scfgs:"shutdown_timeout"` } type IRC struct { - Net string `scfg:"net"` - Addr string `scfg:"addr"` - TLS bool `scfg:"tls"` - SendQ uint `scfg:"sendq"` - Nick string `scfg:"nick"` - User string `scfg:"user"` - Gecos string `scfg:"gecos"` + Net string `scfgs:"net"` + Addr string `scfgs:"addr"` + TLS bool `scfgs:"tls"` + SendQ uint `scfgs:"sendq"` + Nick string `scfgs:"nick"` + User string `scfgs:"user"` + Gecos string `scfgs:"gecos"` } type Git struct { - RepoDir string `scfg:"repo_dir"` - Socket string `scfg:"socket"` + RepoDir string `scfgs:"repo_dir"` + Socket string `scfgs:"socket"` } type General struct { - Title string `scfg:"title"` + Title string `scfgs:"title"` } type Pprof struct { - Net string `scfg:"net"` - Addr string `scfg:"addr"` + Net string `scfgs:"net"` + Addr string `scfgs:"addr"` } func Open(path string) (config Config, err error) { @@ -97,7 +97,7 @@ func Open(path string) (config Config, err error) { _ = configFile.Close() }() - decoder := scfg.NewDecoder(bufio.NewReader(configFile)) + decoder := scfgs.NewDecoder(bufio.NewReader(configFile)) err = decoder.Decode(&config) if err != nil { err = fmt.Errorf("decode config file: %w", err) |
