Introduce "orchard context" (#18)

This commit is contained in:
Nikolay Edigaryev
2023-02-07 19:48:31 +04:00
committed by GitHub
parent a7264370f5
commit 0b9b96b8c9
18 changed files with 656 additions and 5 deletions
+6 -1
View File
@@ -12,6 +12,11 @@ import (
"time"
)
const (
DefaultPort = 6120
DefaultServerName = "orchard-controller"
)
var ErrInitFailed = errors.New("controller initialization failed")
type Controller struct {
@@ -38,7 +43,7 @@ func New(opts ...Option) (*Controller, error) {
ErrInitFailed)
}
if controller.listenAddr == "" {
controller.listenAddr = ":6120"
controller.listenAddr = fmt.Sprintf(":%d", DefaultPort)
}
if controller.logger == nil {
controller.logger = zap.NewNop().Sugar()