Skip to content

Commit

Permalink
revert server
Browse files Browse the repository at this point in the history
  • Loading branch information
mrMigles authored and seiv0814 committed Nov 14, 2024
1 parent 3b17876 commit 4efb4ad
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ tramp
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/

# projectiles files
.projectile
projectile-bookmarks.eld
Expand Down
27 changes: 27 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package server

import (
"git.netcracker.com/PROD.Platform.Streaming/disaster-recovery-daemon/api/entity"
"git.netcracker.com/PROD.Platform.Streaming/disaster-recovery-daemon/config"
"git.netcracker.com/PROD.Platform.Streaming/disaster-recovery-daemon/internal/app"
"log"
)

type Server struct {
config *config.Config
}

func NewServer(config *config.Config) *Server {
return &Server{config: config}
}

func (srv *Server) WithHealthFunc(healthFunc func(request entity.HealthRequest) (entity.HealthResponse, error), fullHealth bool) *Server {
srv.config.HealthConfig.AdditionalHealthStatusConfig.HealthFunc = healthFunc
srv.config.HealthConfig.AdditionalHealthStatusConfig.FullHealthEnabled = fullHealth
return srv
}

func (srv *Server) Run() {
log.Println("DR server started")
app.Run(srv.config)
}

0 comments on commit 4efb4ad

Please sign in to comment.