mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-23 16:42:28 +00:00
* chore: add yaml config ref * feat: add initial implementation of a traefik like cli * refactor: remove dependency on traefik * chore: update example env * refactor: update build * chore: remove unused code * fix: fix translations not loading * feat: add experimental config file support * chore: mod tidy * fix: review comments * refactor: move tinyauth to separate package * chore: add quotes to all env variables * chore: resolve go mod and sum conflicts * chore: go mod tidy * fix: review comments
23 lines
417 B
Go
23 lines
417 B
Go
package loaders
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/traefik/paerser/cli"
|
|
"github.com/traefik/paerser/flag"
|
|
)
|
|
|
|
type FlagLoader struct{}
|
|
|
|
func (*FlagLoader) Load(args []string, cmd *cli.Command) (bool, error) {
|
|
if len(args) == 0 {
|
|
return false, nil
|
|
}
|
|
|
|
if err := flag.Decode(args, cmd.Configuration); err != nil {
|
|
return false, fmt.Errorf("failed to decode configuration from flags: %w", err)
|
|
}
|
|
|
|
return true, nil
|
|
}
|