internal

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterRoleBindingKind       = "ClusterRoleBinding"
	RoleBindingKind              = "RoleBinding"
	ClusterRoleBindingAPIVersion = "rbac.authorization.k8s.io/v1"
	RoleBindingAPIVersion        = "rbac.authorization.k8s.io/v1"
)

Variables

This section is empty.

Functions

func GetClientset

func GetClientset() (*kubernetes.Clientset, error)

GetClientset Creates a new clientset for the kubernetes

Types

type App

type App struct {
	KubeClient *kubernetes.Clientset
	Logger     *zerolog.Logger
}

func (App) GetBindings

func (app App) GetBindings() (*Bindings, error)

func (App) LoggerMiddleware added in v0.0.5

func (l App) LoggerMiddleware(next http.Handler) http.Handler

func (App) ProcessClusterRoleBinding added in v0.0.3

func (app App) ProcessClusterRoleBinding(crb *v1.ClusterRoleBinding) (data struct {
	Nodes []Node `json:"nodes"`
	Links []Link `json:"links"`
})

func (App) ProcessRoleBinding added in v0.0.3

func (app App) ProcessRoleBinding(rb *v1.RoleBinding) (data struct {
	Nodes []Node `json:"nodes"`
	Links []Link `json:"links"`
})

type Bindings

type Bindings struct {
	ClusterRoleBindings *v1.ClusterRoleBindingList `json:"clusterRoleBindings"`
	RoleBindings        *v1.RoleBindingList        `json:"roleBindings"`
}

type Data

type Data struct {
	Id       int          `json:"id"`
	Name     string       `json:"name"`
	Kind     string       `json:"kind"`
	Subjects []v1.Subject `json:"subjects"`
	RoleRef  v1.RoleRef   `json:"roleRef"`
	Raw      string       `json:"raw"`
}

func GenerateData

func GenerateData(bindings *Bindings) []Data

type Generator

type Generator interface {
	GetBindings() (*Bindings, error)
}
type Link struct {
	Source string `json:"source"`
	Target string `json:"target"`
}

type Node added in v0.0.3

type Node struct {
	ID       string `json:"id"`
	Kind     string `json:"kind"`
	ApiGroup string `json:"apiGroup"`
	Label    string `json:"label"`
}

type WhatIfGenerator added in v0.0.3

type WhatIfGenerator interface {
	ProcessClusterRoleBinding(crb *v1.ClusterRoleBinding) struct {
		Nodes []Node `json:"nodes"`
		Links []Link `json:"links"`
	}
	ProcessRoleBinding(rb *v1.RoleBinding) struct {
		Nodes []Node `json:"nodes"`
		Links []Link `json:"links"`
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL