forked from marmotedu/iam
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.go
More file actions
22 lines (17 loc) · 643 Bytes
/
run.go
File metadata and controls
22 lines (17 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2020 Lingfei Kong <[email protected]>. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package pump
import (
genericapiserver "github.com/marmotedu/iam/internal/pkg/server"
"github.com/marmotedu/iam/internal/pump/config"
)
// Run runs the specified pump server. This should never exit.
func Run(cfg *config.Config, stopCh <-chan struct{}) error {
go genericapiserver.ServeHealthCheck(cfg.HealthCheckPath, cfg.HealthCheckAddress)
server, err := createPumpServer(cfg)
if err != nil {
return err
}
return server.PrepareRun().Run(stopCh)
}