mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
remove api config,
This commit is contained in:
@@ -18,7 +18,6 @@ func init() {
|
||||
|
||||
configs := []config.Config{
|
||||
nekoRooms.Service.Configs.Server,
|
||||
nekoRooms.Service.Configs.API,
|
||||
nekoRooms.Service.Configs.Room,
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -5,7 +5,6 @@ import (
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/m1k1o/neko-rooms/internal/config"
|
||||
"github.com/m1k1o/neko-rooms/internal/types"
|
||||
)
|
||||
|
||||
@@ -13,15 +12,13 @@ type ApiManagerCtx struct {
|
||||
logger zerolog.Logger
|
||||
rooms types.RoomManager
|
||||
pull types.PullManager
|
||||
conf *config.API
|
||||
}
|
||||
|
||||
func New(rooms types.RoomManager, pull types.PullManager, conf *config.API) *ApiManagerCtx {
|
||||
func New(rooms types.RoomManager, pull types.PullManager) *ApiManagerCtx {
|
||||
return &ApiManagerCtx{
|
||||
logger: log.With().Str("module", "api").Logger(),
|
||||
rooms: rooms,
|
||||
pull: pull,
|
||||
conf: conf,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type API struct {
|
||||
Lobby bool
|
||||
}
|
||||
|
||||
func (API) Init(cmd *cobra.Command) error {
|
||||
cmd.PersistentFlags().Bool("lobby", true, "show lobby when room is not started yet; in order to show lobby, neko-rooms must run on the same subdomain where rooms are published")
|
||||
if err := viper.BindPFlag("lobby", cmd.PersistentFlags().Lookup("lobby")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *API) Set() {
|
||||
s.Lobby = viper.GetBool("lobby")
|
||||
}
|
||||
@@ -63,7 +63,6 @@ func init() {
|
||||
Configs: &Configs{
|
||||
Root: &config.Root{},
|
||||
Server: &config.Server{},
|
||||
API: &config.API{},
|
||||
Room: &config.Room{},
|
||||
},
|
||||
}
|
||||
@@ -101,7 +100,6 @@ func (i *Version) Details() string {
|
||||
type Configs struct {
|
||||
Root *config.Root
|
||||
Server *config.Server
|
||||
API *config.API
|
||||
Room *config.Room
|
||||
}
|
||||
|
||||
@@ -142,7 +140,6 @@ func (main *MainCtx) Start() {
|
||||
main.apiManager = api.New(
|
||||
main.roomManager,
|
||||
main.pullManager,
|
||||
main.Configs.API,
|
||||
)
|
||||
|
||||
main.proxyManager = proxy.New(
|
||||
|
||||
Reference in New Issue
Block a user