mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-05 12:22:52 +02:00
configs to root.
This commit is contained in:
parent
62353c776d
commit
66d22dede4
3 changed files with 20 additions and 53 deletions
42
neko.go
42
neko.go
|
@ -4,10 +4,7 @@ import (
|
|||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"demodesk/neko/internal/config"
|
||||
"demodesk/neko/modules"
|
||||
)
|
||||
|
||||
const Header = `&34
|
||||
|
@ -101,45 +98,6 @@ type Configs struct {
|
|||
Server *config.Server
|
||||
}
|
||||
|
||||
func (i *Configs) Set() {
|
||||
i.Root.Set()
|
||||
i.Desktop.Set()
|
||||
i.Capture.Set()
|
||||
i.WebRTC.Set()
|
||||
i.Member.Set()
|
||||
i.Session.Set()
|
||||
i.Server.Set()
|
||||
modules.SetConfigs()
|
||||
}
|
||||
|
||||
func (i *Configs) Init(cmd *cobra.Command) error {
|
||||
if err := i.Root.Init(cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := i.Desktop.Init(cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := i.Capture.Init(cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := i.WebRTC.Init(cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := i.Member.Init(cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := i.Session.Init(cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := i.Server.Init(cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := modules.InitConfigs(cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Neko struct {
|
||||
Version *Version
|
||||
Configs *Configs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue