gopay/internal/config/config.go

50 lines
1.2 KiB
Go
Raw Normal View History

2024-06-02 13:36:48 +00:00
// Copyright 2024 perp (supernets)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
2024-06-02 11:57:14 +00:00
package config
// Configuration
type Config struct {
2024-06-03 11:42:58 +00:00
Auth *Auth
2024-06-02 13:07:09 +00:00
Server *Server
2024-06-02 11:57:14 +00:00
Database *Database
Log *Log
}
2024-06-03 11:42:58 +00:00
// Auth configuration
type Auth struct {
2024-06-03 12:42:05 +00:00
Secret string `toml:"secret"`
2024-06-03 12:19:29 +00:00
Disabled bool `toml:"disabled"`
2024-06-03 11:42:58 +00:00
}
2024-06-02 13:07:09 +00:00
// Server configuration
type Server struct {
Address string `toml:"address"`
ReadTimeout int `toml:"read_timeout"`
WriteTimeout int `toml:"write_timeout"`
}
2024-06-02 11:57:14 +00:00
// Database configuration
type Database struct {
2024-06-02 11:58:48 +00:00
Driver string `toml:"driver"`
URL string `toml:"url"`
Max int `toml:"max"`
Idle int `toml:"idle"`
2024-06-02 11:57:14 +00:00
}
// Log configuration
type Log struct {
Level string `toml:"level"`
}