-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
45 lines (34 loc) · 1.09 KB
/
main.go
File metadata and controls
45 lines (34 loc) · 1.09 KB
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
38
39
40
41
42
43
44
45
package main
import (
"log"
"os"
spec "github.com/go-swagger/go-swagger/spec"
flags "github.com/jessevdk/go-flags"
"github.com/deis/workflow-manager-api/pkg/swagger/restapi"
"github.com/deis/workflow-manager-api/pkg/swagger/restapi/operations"
)
// This file was generated by the swagger tool.
// Make sure not to overwrite this file after you generated it because all your edits would be lost!
func main() {
swaggerSpec, err := spec.New(restapi.SwaggerJSON, "")
if err != nil {
log.Fatalln(err)
}
api := operations.NewWorkflowManagerAPI(swaggerSpec)
server := restapi.NewServer(api)
defer server.Shutdown()
parser := flags.NewParser(server, flags.Default)
parser.ShortDescription = `Workflow Manager`
parser.LongDescription = swaggerSpec.Spec().Info.Description
server.ConfigureFlags()
for _, optsGroup := range api.CommandLineOptionsGroups {
parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options)
}
if _, err := parser.Parse(); err != nil {
os.Exit(1)
}
server.ConfigureAPI()
if err := server.Serve(); err != nil {
log.Fatalln(err)
}
}