1
0
Fork 0
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:
Henrik Hautakoski 2024-02-12 15:13:09 +01:00
parent 49faaf5325
commit 4a5cff20cd
4 changed files with 4 additions and 0 deletions

View file

@ -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 {

View file

@ -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",

View file

@ -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 {

View file

@ -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)
}