-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.go
37 lines (30 loc) · 807 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"context"
"flag"
"fmt"
"os"
"path"
"strconv"
"github.com/AliyunContainerService/open-service-broker-alibabacloud/pkg/controller"
"github.com/AliyunContainerService/open-service-broker-alibabacloud/pkg/server"
"github.com/golang/glog"
)
var options struct {
Port int
}
func init() {
flag.IntVar(&options.Port, "port", 8005, "use '--port' option to specify the port for broker to listen on")
flag.Parse()
}
func main() {
if flag.Arg(0) == "version" {
fmt.Printf("%s/%s\n", path.Base(os.Args[0]), "UNKNOWN")
return
}
controller := controller.NewBaseController()
err := server.Run(context.Background(), ":"+strconv.Itoa(options.Port), controller)
if err != nil {
glog.Errorf("Alibaba Cloud Service Broker Server failed to start. Error: %v", err.Error())
}
}