Documentation
¶
Index ¶
- type CRD
- type CRDColumn
- type Client
- type MockClient
- func (_m *MockClient) CopyFileFromPod(ctx context.Context, w http.ResponseWriter, namespace string, name string, ...) error
- func (_m *MockClient) CopyFileToPod(ctx context.Context, namespace string, name string, container string, ...) error
- func (_m *MockClient) CreateResource(ctx context.Context, namespace string, name string, path string, ...) error
- func (_m *MockClient) DeleteResource(ctx context.Context, namespace string, name string, path string, ...) error
- func (_m *MockClient) GetApplication(ctx context.Context, namespace string, name string) (*v1.ApplicationSpec, error)
- func (_m *MockClient) GetApplications(ctx context.Context, namespace string) ([]v1.ApplicationSpec, error)
- func (_m *MockClient) GetCRDs() []CRD
- func (_m *MockClient) GetClient(ctx context.Context, schema *runtime.Scheme) (controllerRuntimeClient.Client, error)
- func (_m *MockClient) GetDashboard(ctx context.Context, namespace string, name string) (*dashboardv1.DashboardSpec, error)
- func (_m *MockClient) GetDashboards(ctx context.Context, namespace string) ([]dashboardv1.DashboardSpec, error)
- func (_m *MockClient) GetLogs(ctx context.Context, namespace string, name string, container string, ...) (string, error)
- func (_m *MockClient) GetName() string
- func (_m *MockClient) GetNamespaces(ctx context.Context) ([]string, error)
- func (_m *MockClient) GetResources(ctx context.Context, namespace string, name string, path string, ...) ([]byte, error)
- func (_m *MockClient) GetTeam(ctx context.Context, namespace string, name string) (*teamv1.TeamSpec, error)
- func (_m *MockClient) GetTeams(ctx context.Context, namespace string) ([]teamv1.TeamSpec, error)
- func (_m *MockClient) GetTerminal(ctx context.Context, conn *websocket.Conn, namespace string, name string, ...) error
- func (_m *MockClient) GetUser(ctx context.Context, namespace string, name string) (*userv1.UserSpec, error)
- func (_m *MockClient) GetUsers(ctx context.Context, namespace string) ([]userv1.UserSpec, error)
- func (_m *MockClient) PatchResource(ctx context.Context, namespace string, name string, path string, ...) error
- func (_m *MockClient) StreamLogs(ctx context.Context, conn *websocket.Conn, namespace string, name string, ...) error
- type NewMockClientT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRD ¶
type CRD struct { ID string `json:"id" bson:"_id"` 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"` UpdatedAt int64 `json:"updatedAt"` }
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 Client ¶
type Client interface { GetName() string GetCRDs() []CRD GetClient(ctx context.Context, schema *runtime.Scheme) (controllerRuntimeClient.Client, error) GetNamespaces(ctx context.Context) ([]string, error) GetResources(ctx context.Context, namespace, name, path, resource, paramName, param string) ([]byte, error) DeleteResource(ctx context.Context, namespace, name, path, resource string, body []byte) error PatchResource(ctx context.Context, namespace, name, path, resource string, body []byte) error CreateResource(ctx context.Context, namespace, name, path, resource, subResource string, body []byte) error GetLogs(ctx context.Context, namespace, name, container, regex string, since, tail int64, previous bool) (string, error) StreamLogs(ctx context.Context, conn *websocket.Conn, namespace, name, container string, since, tail int64, follow bool) error GetTerminal(ctx context.Context, conn *websocket.Conn, namespace, name, container, shell string) error CopyFileFromPod(ctx context.Context, w http.ResponseWriter, namespace, name, container, srcPath string) error CopyFileToPod(ctx context.Context, namespace, name, container string, srcFile multipart.File, destPath string) error GetApplications(ctx context.Context, namespace string) ([]applicationv1.ApplicationSpec, error) GetApplication(ctx context.Context, namespace, name string) (*applicationv1.ApplicationSpec, error) GetTeams(ctx context.Context, namespace string) ([]teamv1.TeamSpec, error) GetTeam(ctx context.Context, namespace, name string) (*teamv1.TeamSpec, error) GetDashboards(ctx context.Context, namespace string) ([]dashboardv1.DashboardSpec, error) GetDashboard(ctx context.Context, namespace, name string) (*dashboardv1.DashboardSpec, error) GetUsers(ctx context.Context, namespace string) ([]userv1.UserSpec, error) GetUser(ctx context.Context, namespace, name string) (*userv1.UserSpec, error) // contains filtered or unexported methods }
Client is the interface to interact with an Kubernetes cluster.
func NewClient ¶
NewClient returns a new client to interact with a Kubernetes cluster. Each cluster must have a unique name and the actual Kubernetes clients to make requests against the Kubernetes API server. When a client was successfully created we call the loadCRDs function to get all CRDs in the Kubernetes cluster.
type MockClient ¶
MockClient is an autogenerated mock type for the Client type
func NewMockClient ¶
func NewMockClient(t NewMockClientT) *MockClient
NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockClient) CopyFileFromPod ¶
func (_m *MockClient) CopyFileFromPod(ctx context.Context, w http.ResponseWriter, namespace string, name string, container string, srcPath string) error
CopyFileFromPod provides a mock function with given fields: ctx, w, namespace, name, container, srcPath
func (*MockClient) CopyFileToPod ¶
func (_m *MockClient) CopyFileToPod(ctx context.Context, namespace string, name string, container string, srcFile multipart.File, destPath string) error
CopyFileToPod provides a mock function with given fields: ctx, namespace, name, container, srcFile, destPath
func (*MockClient) CreateResource ¶
func (_m *MockClient) CreateResource(ctx context.Context, namespace string, name string, path string, resource string, subResource string, body []byte) error
CreateResource provides a mock function with given fields: ctx, namespace, name, path, resource, subResource, body
func (*MockClient) DeleteResource ¶
func (_m *MockClient) DeleteResource(ctx context.Context, namespace string, name string, path string, resource string, body []byte) error
DeleteResource provides a mock function with given fields: ctx, namespace, name, path, resource, body
func (*MockClient) GetApplication ¶
func (_m *MockClient) GetApplication(ctx context.Context, namespace string, name string) (*v1.ApplicationSpec, error)
GetApplication provides a mock function with given fields: ctx, namespace, name
func (*MockClient) GetApplications ¶
func (_m *MockClient) GetApplications(ctx context.Context, namespace string) ([]v1.ApplicationSpec, error)
GetApplications provides a mock function with given fields: ctx, namespace
func (*MockClient) GetCRDs ¶
func (_m *MockClient) GetCRDs() []CRD
GetCRDs provides a mock function with given fields:
func (*MockClient) GetClient ¶
func (_m *MockClient) GetClient(ctx context.Context, schema *runtime.Scheme) (controllerRuntimeClient.Client, error)
GetClient provides a mock function with given fields: ctx, schema
func (*MockClient) GetDashboard ¶
func (_m *MockClient) GetDashboard(ctx context.Context, namespace string, name string) (*dashboardv1.DashboardSpec, error)
GetDashboard provides a mock function with given fields: ctx, namespace, name
func (*MockClient) GetDashboards ¶
func (_m *MockClient) GetDashboards(ctx context.Context, namespace string) ([]dashboardv1.DashboardSpec, error)
GetDashboards provides a mock function with given fields: ctx, namespace
func (*MockClient) GetLogs ¶
func (_m *MockClient) GetLogs(ctx context.Context, namespace string, name string, container string, regex string, since int64, tail int64, previous bool) (string, error)
GetLogs provides a mock function with given fields: ctx, namespace, name, container, regex, since, tail, previous
func (*MockClient) GetName ¶
func (_m *MockClient) GetName() string
GetName provides a mock function with given fields:
func (*MockClient) GetNamespaces ¶
func (_m *MockClient) GetNamespaces(ctx context.Context) ([]string, error)
GetNamespaces provides a mock function with given fields: ctx
func (*MockClient) GetResources ¶
func (_m *MockClient) GetResources(ctx context.Context, namespace string, name string, path string, resource string, paramName string, param string) ([]byte, error)
GetResources provides a mock function with given fields: ctx, namespace, name, path, resource, paramName, param
func (*MockClient) GetTeam ¶
func (_m *MockClient) GetTeam(ctx context.Context, namespace string, name string) (*teamv1.TeamSpec, error)
GetTeam provides a mock function with given fields: ctx, namespace, name
func (*MockClient) GetTerminal ¶
func (_m *MockClient) GetTerminal(ctx context.Context, conn *websocket.Conn, namespace string, name string, container string, shell string) error
GetTerminal provides a mock function with given fields: ctx, conn, namespace, name, container, shell
func (*MockClient) GetUser ¶
func (_m *MockClient) GetUser(ctx context.Context, namespace string, name string) (*userv1.UserSpec, error)
GetUser provides a mock function with given fields: ctx, namespace, name
func (*MockClient) PatchResource ¶
func (_m *MockClient) PatchResource(ctx context.Context, namespace string, name string, path string, resource string, body []byte) error
PatchResource provides a mock function with given fields: ctx, namespace, name, path, resource, body
func (*MockClient) StreamLogs ¶
func (_m *MockClient) StreamLogs(ctx context.Context, conn *websocket.Conn, namespace string, name string, container string, since int64, tail int64, follow bool) error
StreamLogs provides a mock function with given fields: ctx, conn, namespace, name, container, since, tail, follow