diff --git a/app/config/cli.go b/app/config/cli.go index 1ff3b2b..8fa44bc 100644 --- a/app/config/cli.go +++ b/app/config/cli.go @@ -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 { diff --git a/app/config/config.go b/app/config/config.go index 091edd9..1e71e33 100644 --- a/app/config/config.go +++ b/app/config/config.go @@ -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", diff --git a/app/config/file.go b/app/config/file.go index b1b4863..d47444e 100644 --- a/app/config/file.go +++ b/app/config/file.go @@ -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 { diff --git a/app/config/yaml.go b/app/config/yaml.go index b1d7db8..60a2097 100644 --- a/app/config/yaml.go +++ b/app/config/yaml.go @@ -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) }