move server to server directory.

This commit is contained in:
Miroslav Šedivý 2024-06-23 17:48:14 +02:00
parent da45f62ca8
commit cfb423b13d
211 changed files with 18 additions and 10 deletions

View file

@ -0,0 +1,23 @@
package chat
import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
type Config struct {
Enabled bool
}
func (Config) Init(cmd *cobra.Command) error {
cmd.PersistentFlags().Bool("chat.enabled", true, "whether to enable chat plugin")
if err := viper.BindPFlag("chat.enabled", cmd.PersistentFlags().Lookup("chat.enabled")); err != nil {
return err
}
return nil
}
func (s *Config) Set() {
s.Enabled = viper.GetBool("chat.enabled")
}