read config from stdin

This commit is contained in:
ginuerzh
2025-06-28 18:09:04 +08:00
parent fe096d6e74
commit c8d905dea5
2 changed files with 22 additions and 7 deletions
+3 -2
View File
@@ -145,7 +145,7 @@ type AutherConfig struct {
type AuthConfig struct {
Username string `yaml:",omitempty" json:"username,omitempty"`
Password string `yaml:",omitempty" json:"password,omitempty"`
File string `yaml:",omitempty" json:"file,omitempty"`
File string `yaml:",omitempty" json:"file,omitempty"`
}
type SelectorConfig struct {
@@ -578,7 +578,8 @@ func (c *Config) Load() error {
return v.Unmarshal(c)
}
func (c *Config) Read(r io.Reader) error {
func (c *Config) Read(r io.Reader, configType string) error {
v.SetConfigType(configType)
if err := v.ReadConfig(r); err != nil {
return err
}