mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
app/config: Adding description to methods.
This commit is contained in:
parent
49faaf5325
commit
4a5cff20cd
4 changed files with 4 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// Read cli flag values into the config
|
||||
func (cfg *Config) ReadCliFlags(ctx *cli.Context) error {
|
||||
logFile := ctx.Path("log")
|
||||
if len(logFile) > 0 {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ type Config struct {
|
|||
Telegram TelegramConfig `yaml:"telegram"`
|
||||
}
|
||||
|
||||
// Create a new Config object with default values
|
||||
func New() Config {
|
||||
return Config{
|
||||
MessageCodec: "json",
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import (
|
|||
"os"
|
||||
)
|
||||
|
||||
// Read values from file
|
||||
func (cfg *Config) ReadFile(filename string) error {
|
||||
bytes, err := os.ReadFile(filename)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ func (ship *ShipConfig) UnmarshalYAML(value *yaml.Node) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Read YAML config data
|
||||
func (cfg *Config) ReadYAML(data []byte) error {
|
||||
return yaml.Unmarshal(data, cfg)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue