Documentation
¶
Overview ¶
The scope of this file is: - Define the configuration struct. - Set default configuration values. - Map the data so viper can load the configuration there. See: https://articles.wesionary.team/environment-variable-configuration-in-your-golang-project-using-viper-4e8289ef664d See: https://consoledot.pages.redhat.com/docs/dev/getting-started/migration/config.html
Index ¶
Constants ¶
View Source
const ( // DefaultAppName is used to compose the route paths DefaultAppName = "todo" // API URL path prefix DefaultPathPrefix = "/api/" + DefaultAppName + "/v1" // DefaultExpirationTime is used for the default token expiration period // expressed in seconds. The default value is set to 7200 (2 hours) DefaultTokenExpirationTimeSeconds = 7200 // DefaultWebPort is the default port where the public API is listening DefaultWebPort = 8000 // PaginationDefaultLimit is the default limit for the pagination PaginationDefaultLimit = 10 // PaginationMaxLimit is the default max limit for the pagination PaginationMaxLimit = 1000 // DefaultValidateAPI is true DefaultValidateAPI = true )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application struct { // PathPrefix is the API URL's path prefix, e.g. /api/todo PathPrefix string `mapstructure:"url_path_prefix" validate:"required"` // Indicate the default pagination limit when it is 0 or not filled PaginationDefaultLimit int `mapstructure:"pagination_default_limit"` // Indicate the max pagination limit when it is grather PaginationMaxLimit int `mapstructure:"pagination_max_limit"` // ValidateAPI enable the API validation for every request ValidateAPI bool `mapstructure:"validate_api"` }
Application hold specific application settings
type Clients ¶
type Clients struct {
Inventory InventoryClient
}
Clients gather all the client settings for the
type Cloudwatch ¶
type Config ¶
type Config struct { Loaded bool Web Web Database Database Logging Logging Cloudwatch Cloudwatch Metrics Metrics Clients Clients Application Application `mapstructure:"app"` }
type InventoryClient ¶
type InventoryClient struct { // Define the base url for the host inventory service BaseUrl string `mapstructure:"base_url"` }
Click to show internal directories.
Click to hide internal directories.