Extract configuration types

This commit is contained in:
2022-03-08 11:41:19 +01:00
parent 53a95b1d50
commit 3460c7b815
3 changed files with 29 additions and 23 deletions

23
config.go Normal file
View File

@ -0,0 +1,23 @@
package main
// Config holds the configuration for Idicon service.
type Config struct {
Defaults Defaults `toml:"defaults"`
Users []UserConfig `toml:"users"`
}
// Defaults holds default configuration values to be used as defaults for all users.
type Defaults struct {
ColorScheme string `toml:"color-scheme"`
Pattern string `toml:"pattern"`
}
// UserConfig holds user specific configuration.
// ID is the id od the user in plain text,
// Alias is the alias to be used to generate the id icon.
type UserConfig struct {
ID string `toml:"id"`
Alias string `toml:"alias"`
ColorScheme string `toml:"color-scheme"`
Pattern string `toml:"pattern"`
}