Fixes #7. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
e486d3df98
commit
0ce540e92d
7 changed files with 141 additions and 18 deletions
|
@ -7,18 +7,22 @@ import (
|
|||
)
|
||||
|
||||
type Config struct {
|
||||
Title string `json:"title"`
|
||||
DatabaseType string `json:"database_type"`
|
||||
DatabaseDsn string `json:"database_dsn"`
|
||||
IDLength int `json:"id_length"`
|
||||
PasswordLength int `json:"password_length"`
|
||||
ExpirationInterval int `json:"expiration_interval"`
|
||||
ListenAddress string `json:"listen_address"`
|
||||
ListenPort int `json:"listen_port"`
|
||||
Expirations []int `json:"expirations"`
|
||||
Expiration int `json:"expiration"`
|
||||
MaxUploadSize int64 `json:"max_upload_size"`
|
||||
ShowVersion bool `json:"show_version"`
|
||||
Title string `json:"title"`
|
||||
DatabaseType string `json:"database_type"`
|
||||
DatabaseDsn string `json:"database_dsn"`
|
||||
IDLength int `json:"id_length"`
|
||||
PasswordLength int `json:"password_length"`
|
||||
ExpirationInterval int `json:"expiration_interval"`
|
||||
ListenAddress string `json:"listen_address"`
|
||||
ListenPort int `json:"listen_port"`
|
||||
Expirations []int `json:"expirations"`
|
||||
Expiration int `json:"expiration"`
|
||||
MaxUploadSize int64 `json:"max_upload_size"`
|
||||
ShowVersion bool `json:"show_version"`
|
||||
EnableMetrics bool `json:"enable_metrics"`
|
||||
PrometheusRoute string `json:"prometheus_route"`
|
||||
PrometheusNotesMetric string `json:"prometheus_notes_metric"`
|
||||
ObservationInterval int `json:"observation_internal"`
|
||||
}
|
||||
|
||||
func NewConfig() *Config {
|
||||
|
@ -38,9 +42,13 @@ func NewConfig() *Config {
|
|||
604800, // 7 days
|
||||
18144000, // 30 days
|
||||
},
|
||||
Expiration: 604800, // 7 days
|
||||
MaxUploadSize: 10485760, // 10MiB (encoded)
|
||||
ShowVersion: false,
|
||||
Expiration: 604800, // 7 days
|
||||
MaxUploadSize: 10485760, // 10MiB (encoded)
|
||||
ShowVersion: false,
|
||||
EnableMetrics: false,
|
||||
PrometheusRoute: "/metrics",
|
||||
PrometheusNotesMetric: "collerd_notes",
|
||||
ObservationInterval: 60,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue