Documentation ¶
Index ¶
- func CheckIfError(err error)
- func HandleError(w http.ResponseWriter, err error)
- func Info(format string, args ...interface{})
- func RespondFilter(r *http.Request, w http.ResponseWriter, status int, ...) error
- func RespondFormat[T any](r *http.Request, w http.ResponseWriter, status int, payload T) error
- func RespondGraph(r *http.Request, w http.ResponseWriter, status int, ...) error
- func RespondJSON[T any](w http.ResponseWriter, status int, payload T) error
- func RespondOK(w http.ResponseWriter, response string) error
- func RespondText(w http.ResponseWriter, status int, payload string) error
- func RespondYAML[T any](w http.ResponseWriter, status int, payload T) error
- func Warning(format string, args ...interface{})
- type ApiClient
- type App
- type AuthManager
- type Authorization
- type Client
- type Edge
- type Error
- type Graph
- type JwtCustomClaims
- type KubeClient
- type Node
- type NodeOptions
- type ObjectList
- type Public
- type RequestUrl
- type StatusError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfError ¶
func CheckIfError(err error)
func HandleError ¶
func HandleError(w http.ResponseWriter, err error)
func RespondFilter ¶
func RespondFilter(r *http.Request, w http.ResponseWriter, status int, list *unstructured.UnstructuredList) error
func RespondFormat ¶
func RespondGraph ¶
func RespondGraph(r *http.Request, w http.ResponseWriter, status int, list *unstructured.UnstructuredList, url *RequestUrl) error
func RespondJSON ¶
func RespondJSON[T any](w http.ResponseWriter, status int, payload T) error
func RespondText ¶
func RespondText(w http.ResponseWriter, status int, payload string) error
func RespondYAML ¶
func RespondYAML[T any](w http.ResponseWriter, status int, payload T) error
Types ¶
type ApiClient ¶
type App ¶
type App struct { Addr *string Router *http.ServeMux KubeConfigPath *string ApiServerHost *string ProxyUrl *string InCluster *bool FileServer *bool FileServerPath *string Client *Client AuthManager AuthManager // config PodLogTailLines *int64 DefaultConfigName *string TokenExpirationHours *int64 }
func (*App) LoadKubeContext ¶
type AuthManager ¶
func NewAuthManager ¶
func NewAuthManager(k8s *kubernetes.Clientset) AuthManager
type Authorization ¶
func (Authorization) ServeHTTP ¶
func (auth Authorization) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Client ¶
type Client struct { Clientset *kubernetes.Clientset ApiClient *clientset.Clientset Config *rest.Config Dynamic *dynamic.DynamicClient Discovery *discovery.DiscoveryClient }
func (*Client) ExecCommand ¶
func (*Client) GetAPIResource ¶
func (c *Client) GetAPIResource(obj *unstructured.Unstructured) (*metav1.APIResource, error)
func (*Client) GetContainer ¶
func (c *Client) GetContainer(url RequestUrl) (string, error)
type JwtCustomClaims ¶
type JwtCustomClaims struct { Username string `json:"username"` Token string `json:"token"` jwt.RegisteredClaims }
type KubeClient ¶
type KubeClient struct { *App H func(a *App, c *Client, w http.ResponseWriter, r *http.Request) error }
func (KubeClient) ServeHTTP ¶
func (kc KubeClient) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Node ¶
type Node struct { Id string `json:"id,omitempty"` Data struct { Label string `json:"label,omitempty"` Group bool `json:"group,omitempty"` Kind string `json:"kind,omitempty"` Namespace string `json:"namespace,omitempty"` Containers []string `json:"containers,omitempty"` Status string `json:"status,omitempty"` Age string `json:"age,omitempty"` Ready string `json:"ready,omitempty"` Restarts string `json:"restarts,omitempty"` } `json:"data,omitempty"` // optional Position string `json:"position,omitempty"` Style struct { Width int `json:"width,omitempty"` Height int `json:"height,omitempty"` } `json:"style,omitempty"` Type string `json:"type,omitempty"` ParentNode string `json:"parentNode,omitempty"` Extent string `json:"extent,omitempty"` Draggable bool `json:"draggable"` Connectable bool `json:"connectable"` }
type NodeOptions ¶
type ObjectList ¶
type RequestUrl ¶
func GetRequestParams ¶
func GetRequestParams(r *http.Request, path string) RequestUrl
type StatusError ¶
func RespondError ¶
func RespondError(args ...interface{}) StatusError
func (StatusError) Error ¶
func (se StatusError) Error() string
func (StatusError) Message ¶
func (se StatusError) Message() string
func (StatusError) Status ¶
func (se StatusError) Status() int
Click to show internal directories.
Click to hide internal directories.