Documentation
¶
Index ¶
- type CRD
- type CRDColumn
- type Cache
- type Cluster
- func (c *Cluster) CreateResource(ctx context.Context, namespace, name, path, resource, subResource string, ...) error
- func (c *Cluster) DeleteResource(ctx context.Context, namespace, name, path, resource string, body []byte) error
- func (c *Cluster) GetApplication(ctx context.Context, namespace, name string) (*application.ApplicationSpec, error)
- func (c *Cluster) GetApplications(ctx context.Context, namespace string) ([]application.ApplicationSpec, error)
- func (c *Cluster) GetCRDs() []CRD
- func (c *Cluster) GetDashboard(ctx context.Context, namespace, name string) (*dashboard.DashboardSpec, error)
- func (c *Cluster) GetDashboards(ctx context.Context, namespace string) ([]dashboard.DashboardSpec, error)
- func (c *Cluster) GetLogs(ctx context.Context, namespace, name, container, regex string, ...) (string, error)
- func (c *Cluster) GetName() string
- func (c *Cluster) GetNamespaces(ctx context.Context, cacheDuration time.Duration) ([]string, error)
- func (c *Cluster) GetResources(ctx context.Context, namespace, name, path, resource, paramName, param string) ([]byte, error)
- func (c *Cluster) GetTeam(ctx context.Context, namespace, name string) (*team.TeamSpec, error)
- func (c *Cluster) GetTeams(ctx context.Context, namespace string) ([]team.TeamSpec, error)
- func (c *Cluster) GetTerminal(conn *websocket.Conn, namespace, name, container, shell string) error
- func (c *Cluster) PatchResource(ctx context.Context, namespace, name, path, resource string, body []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRD ¶
type CRD struct { Path string `json:"path"` Resource string `json:"resource"` Title string `json:"title"` Description string `json:"description"` Scope string `json:"scope"` Columns []CRDColumn `json:"columns,omitempty"` }
CRD is the format of a Custom Resource Definition. Each CRD must contain a path and resource, which are used for the API request to retrieve all CRs for a CRD. It also must contain a title (kind), an optional description, the scope of the CRs (namespaced vs. cluster) and an optional list of columns with the fields, which should be shown in the frontend table.
type CRDColumn ¶
type CRDColumn struct { Description string `json:"description"` JSONPath string `json:"jsonPath"` Name string `json:"name"` Type string `json:"type"` }
CRDColumn is a single column for the CRD. A column has the same fields as the additionalPrinterColumns from the CRD specs. This means each column contains a description, name, a type to formate the value returned by the given jsonPath.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache implements a simple caching layer, for the loaded manifest files. The goal of the caching layer is to return the manifests faster to the user.
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster is a Kubernetes cluster. It contains all required fields to interact with the cluster and it's services.
func NewCluster ¶
NewCluster returns a new cluster. Each cluster must have a unique name and a client to make requests against the Kubernetes API server of this cluster. When a cluster was successfully created we call the loadCRDs function to get all CRDs for this cluster.
func (*Cluster) CreateResource ¶ added in v0.5.0
func (c *Cluster) CreateResource(ctx context.Context, namespace, name, path, resource, subResource string, body []byte) error
CreateResource can be used to create the given resource. The resource is identified by the Kubernetes API path and the name of the resource.
func (*Cluster) DeleteResource ¶ added in v0.5.0
func (c *Cluster) DeleteResource(ctx context.Context, namespace, name, path, resource string, body []byte) error
DeleteResource can be used to delete the given resource. The resource is identified by the Kubernetes API path and the name of the resource.
func (*Cluster) GetApplication ¶
func (c *Cluster) GetApplication(ctx context.Context, namespace, name string) (*application.ApplicationSpec, error)
GetApplication returns a application for the given namespace and name. After the application is retrieved we replace, the cluster, namespace and name in the spec of the Application CR. This is needed, so that the user doesn't have to, provide these fields.
func (*Cluster) GetApplications ¶
func (c *Cluster) GetApplications(ctx context.Context, namespace string) ([]application.ApplicationSpec, error)
GetApplications returns a list of applications gor the given namespace. It also adds the cluster, namespace and application name to the Application CR, so that this information must not be specified by the user in the CR.
func (*Cluster) GetDashboard ¶
func (c *Cluster) GetDashboard(ctx context.Context, namespace, name string) (*dashboard.DashboardSpec, error)
GetDashboard returns a dashboard for the given namespace and name. After the dashboard is retrieved we replace, the cluster, namespace and name in the spec of the Dashboard CR. This is needed, so that the user doesn't have to, provide these fields.
func (*Cluster) GetDashboards ¶
func (c *Cluster) GetDashboards(ctx context.Context, namespace string) ([]dashboard.DashboardSpec, error)
GetDashboards returns a list of dashboards gor the given namespace. It also adds the cluster, namespace and dashboard name to the Dashboard CR, so that this information must not be specified by the user in the CR.
func (*Cluster) GetLogs ¶
func (c *Cluster) GetLogs(ctx context.Context, namespace, name, container, regex string, since, tail int64, previous bool) (string, error)
GetLogs returns the logs for a Container. The Container is identified by the namespace and pod name and the container name. Is is also possible to set the time since when the logs should be received and with the previous flag the logs for the last container can be received.
func (*Cluster) GetNamespaces ¶
GetNamespaces returns all namespaces for the cluster. To reduce the latency and the number of API calls, we are "caching" the namespaces. This means that if a new namespace is created in a cluster, this namespaces is only shown after the configured cache duration.
func (*Cluster) GetResources ¶
func (c *Cluster) GetResources(ctx context.Context, namespace, name, path, resource, paramName, param string) ([]byte, error)
GetResources returns a list for the given resource in the given namespace. The resource is identified by the Kubernetes API path and the resource. The name is optional and can be used to get a single resource, instead of a list of resources.
func (*Cluster) GetTeam ¶
GetTeam returns a team for the given namespace and name. After the team is retrieved we replace, the cluster, namespace and name in the spec of the Team CR. This is needed, so that the user doesn't have to, provide these fields.
func (*Cluster) GetTeams ¶
GetTeams returns a list of teams gor the given namespace. It also adds the cluster, namespace and team name to the Team CR, so that this information must not be specified by the user in the CR.
func (*Cluster) GetTerminal ¶ added in v0.5.0
GetTerminal starts a new terminal session via the given WebSocket connection.