-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmain.go
42 lines (35 loc) · 790 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
38
39
40
41
42
//go:generate fileb0x fileb0x.yaml
package main
import (
"flag"
log "github.com/Sirupsen/logrus"
_ "k8s.io/client-go/plugin/pkg/client/auth"
"github.com/jasonrichardsmith/rbac-view/client"
"github.com/jasonrichardsmith/rbac-view/matrix"
"github.com/jasonrichardsmith/rbac-view/render"
"github.com/jasonrichardsmith/rbac-view/render/controller"
)
var (
rendertype string
)
func init() {
flag.StringVar(&rendertype, "render", "html", "render type: json, html")
}
func main() {
flag.Parse()
log.Info("Getting K8s client")
c, err := client.New()
if err != nil {
log.Fatal(err)
}
m := matrix.New(c)
var render render.Renderer
render, err = controller.New(rendertype, m)
if err != nil {
log.Fatal(err)
}
err = render.Render()
if err != nil {
log.Fatal(err)
}
}