list-nodes command action (#87)

* list-nodes command action

* refactor stats into a package

* store existing stats in redis, more refactoring

* dz review: atomic load
This commit is contained in:
Mathew Kamkar
2021-08-24 10:14:39 -07:00
committed by GitHub
parent a8b0125e42
commit f5466c74e6
15 changed files with 428 additions and 294 deletions
+11
View File
@@ -17,3 +17,14 @@ func InitializeServer(conf *config.Config, keyProvider auth.KeyProvider, current
)
return &LivekitServer{}, nil
}
func InitializeRouter(conf *config.Config, currentNode routing.LocalNode) (routing.Router, error) {
wire.Build(
wire.NewSet(
createRedisClient,
createRouter,
),
)
return nil, nil
}
+11 -1
View File
@@ -1,7 +1,8 @@
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//+build !wireinject
//go:build !wireinject
// +build !wireinject
package service
@@ -44,3 +45,12 @@ func InitializeServer(conf *config.Config, keyProvider auth.KeyProvider, current
}
return livekitServer, nil
}
func InitializeRouter(conf *config.Config, currentNode routing.LocalNode) (routing.Router, error) {
client, err := createRedisClient(conf)
if err != nil {
return nil, err
}
router := createRouter(client, currentNode)
return router, nil
}