Documentation ¶
Index ¶
- Constants
- func CRDAPIVersions(crd *unstructured.Unstructured) ([]schema.GroupVersion, error)
- type CRDPathGenFunc
- type ClientRequestHandler
- type ContainerEditor
- type ContentPathUpdateFunc
- type DeploymentConfigurationEditor
- type EntriesFunc
- type Event
- type EventType
- type Filter
- type Generator
- type NamespaceUpdateFunc
- type NavigationEntries
- type NavigationFactory
- type ObjectPath
- func (op *ObjectPath) AddCRD(ctx context.Context, crd *unstructured.Unstructured) error
- func (op *ObjectPath) GroupVersionKindPath(namespace, apiVersion, kind, name string) (string, error)
- func (op *ObjectPath) RemoveCRD(ctx context.Context, crd *unstructured.Unstructured) error
- func (op *ObjectPath) ResetCRDs(ctx context.Context) error
- func (op *ObjectPath) SupportedGroupVersionKind() []schema.GroupVersionKind
- type ObjectPathConfig
- type PathLookupFunc
- type ServiceConfigurationEditor
- type State
- type UpdateCancelFunc
Constants ¶
const (
ActionDeleteObject = "lissio/deleteObject"
)
Variables ¶
This section is empty.
Functions ¶
func CRDAPIVersions ¶
func CRDAPIVersions(crd *unstructured.Unstructured) ([]schema.GroupVersion, error)
CRDAPIVersions returns the group versions that are contained within a CRD.
Types ¶
type CRDPathGenFunc ¶
CRDPathGenFunc is a function that generates a custom resource path.
type ClientRequestHandler ¶
type ClientRequestHandler struct { RequestType string Handler func(state State, payload action.Payload) error }
ClientRequestHandler is a client request.
type ContainerEditor ¶
type ContainerEditor struct {
// contains filtered or unexported fields
}
ContainerEditor edits containers.
func NewContainerEditor ¶
func NewContainerEditor(objectStore store.Store) *ContainerEditor
NewContainerEditor creates an instance of ContainerEditor.
func (*ContainerEditor) ActionName ¶
func (e *ContainerEditor) ActionName() string
ActionName returns name of this action.
type ContentPathUpdateFunc ¶
type ContentPathUpdateFunc func(contentPath string)
ContentPathUpdateFunc is a function that is called when content path is updated.
type DeploymentConfigurationEditor ¶
type DeploymentConfigurationEditor struct {
// contains filtered or unexported fields
}
DeploymentConfigurationEditor edits a deployment's configuration.
func NewDeploymentConfigurationEditor ¶
func NewDeploymentConfigurationEditor(logger log.Logger, objectStore store.Store) *DeploymentConfigurationEditor
NewDeploymentConfigurationEditor edits a deployment.
func (*DeploymentConfigurationEditor) ActionName ¶
func (e *DeploymentConfigurationEditor) ActionName() string
ActionName returns the action name for this editor.
type EntriesFunc ¶
type EntriesFunc func(ctx context.Context, prefix, namespace string, objectStore store.Store, wantsClusterScoped bool) ([]navigation.Navigation, bool, error)
EntriesFunc is a function that can create navigation entries.
type EventType ¶
type EventType string
const ( // EventTypeContent is a content event. EventTypeContent EventType = "content" // EventTypeNamespaces is a namespaces event. EventTypeNamespaces EventType = "namespaces" EventTypeNavigation EventType = "navigation" // EventTypeObjectNotFound is an object not found event. EventTypeObjectNotFound EventType = "objectNotFound" // EventTypeCurrentNamespace is a current namespace event. EventTypeCurrentNamespace EventType = "currentNamespace" // EventTypeUnknown is an unknown event. EventTypeUnknown EventType = "unknown" // EventTypeNamespace is a namespace event. EventTypeNamespace EventType = "namespace" // EventTypeContext is a context event. EventTypeContext EventType = "context" // EventTypeKubeConfig is an event for updating kube contexts on the front end. EventTypeKubeConfig EventType = "kubeConfig" // EventTypeContentPath is a content path event. EventTypeContentPath EventType = "contentPath" // EventTypeFilters is a filters event. EventTypeFilters EventType = "filters" // EventTypeAlert is an alert event. EventTypeAlert EventType = "alert" )
type Filter ¶
Filter is used to filter queries for objects. Typically, the filter is an object's label.
func (*Filter) ToQueryParam ¶
ToQueryParam converts the filter to a query parameter.
type Generator ¶
type Generator interface { // Event generates events using the returned channel. Event(ctx context.Context) (Event, error) // ScheduleDelay is how long to wait before scheduling this generator again. ScheduleDelay() time.Duration // Name is the generator name. Name() string }
Generator generates events.
type NamespaceUpdateFunc ¶
type NamespaceUpdateFunc func(namespace string)
NamespaceUpdateFunc is a function that is called when namespace is updated.
type NavigationEntries ¶
type NavigationEntries struct {}
NavigationEntries help construct navigation entries.
type NavigationFactory ¶
type NavigationFactory struct {
// contains filtered or unexported fields
}
NavigationFactory generates navigation entries.
func NewNavigationFactory ¶
func NewNavigationFactory(namespace string, root string, objectStore store.Store, entries NavigationEntries) *NavigationFactory
NewNavigationFactory creates an instance of NewNavigationFactory.
func (*NavigationFactory) Generate ¶
func (nf *NavigationFactory) Generate(ctx context.Context, title string, iconName, iconSource string, wantsClusterScoped bool) (*navigation.Navigation, error)
Generate returns navigation entries.
func (*NavigationFactory) Root ¶
func (nf *NavigationFactory) Root() string
Root returns the rootPath of the navigation tree.
type ObjectPath ¶
type ObjectPath struct {
// contains filtered or unexported fields
}
ObjectPath contains functions for generating paths for an object. Typically this is a helper which can be embedded in modules.
func NewObjectPath ¶
func NewObjectPath(config ObjectPathConfig) (*ObjectPath, error)
NewObjectPath creates ObjectPath.
func (*ObjectPath) AddCRD ¶
func (op *ObjectPath) AddCRD(ctx context.Context, crd *unstructured.Unstructured) error
AddCRD adds support for a CRD to the ObjectPath.
func (*ObjectPath) GroupVersionKindPath ¶
func (op *ObjectPath) GroupVersionKindPath(namespace, apiVersion, kind, name string) (string, error)
GroupVersionKind returns a path for an object.
func (*ObjectPath) RemoveCRD ¶
func (op *ObjectPath) RemoveCRD(ctx context.Context, crd *unstructured.Unstructured) error
RemoveCRD removes support for a CRD from the ObjectPath.
func (*ObjectPath) ResetCRDs ¶
func (op *ObjectPath) ResetCRDs(ctx context.Context) error
ResetCRDs deletes all the CRD paths ObjectPath is tracking.
func (*ObjectPath) SupportedGroupVersionKind ¶
func (op *ObjectPath) SupportedGroupVersionKind() []schema.GroupVersionKind
SupportedGroupVersionKind returns a slice of GVKs this object path can handle.
type ObjectPathConfig ¶
type ObjectPathConfig struct { ModuleName string SupportedGVKs []schema.GroupVersionKind PathLookupFunc PathLookupFunc CRDPathGenFunc CRDPathGenFunc }
ObjectPathConfig is configuration for ObjectPath.
func (*ObjectPathConfig) Validate ¶
func (opc *ObjectPathConfig) Validate() error
Validate returns an error if the configuration is invalid.
type PathLookupFunc ¶
PathLookupFunc looks up paths for an object.
type ServiceConfigurationEditor ¶
type ServiceConfigurationEditor struct {
// contains filtered or unexported fields
}
ServiceConfigurationEditor edits editors.
func NewServiceConfigurationEditor ¶
func NewServiceConfigurationEditor(objectStore store.Store) *ServiceConfigurationEditor
NewServiceConfigurationEditor creates an instance of ServiceConfigurationEditor.
func (*ServiceConfigurationEditor) ActionName ¶
func (s *ServiceConfigurationEditor) ActionName() string
ActionName returns the name of this action.
type State ¶
type State interface { // SetContentPath sets the content path. SetContentPath(string) // GetContentPath returns the content path. GetContentPath() string // OnNamespaceUpdate registers a function to be called with the content path // is changed. OnContentPathUpdate(fn ContentPathUpdateFunc) UpdateCancelFunc // GetQueryParams returns the query params. GetQueryParams() map[string][]string // SetNamespace sets the namespace. SetNamespace(namespace string) // GetNamespace returns the namespace. GetNamespace() string // OnNamespaceUpdate returns a function to be called when the namespace // is changed. OnNamespaceUpdate(fun NamespaceUpdateFunc) UpdateCancelFunc // AddFilter adds a label to filtered. AddFilter(filter Filter) // RemoveFilter removes a filter. RemoveFilter(filter Filter) // GetFilters returns a slice of filters. GetFilters() []Filter // SetFilters replaces the current filters with a slice of filters. // The slice can be empty. SetFilters(filters []Filter) // SetContext sets the current context. SetContext(requestedContext string) // Dispatch dispatches a payload for an action. Dispatch(ctx context.Context, actionName string, payload action.Payload) error // SendAlert sends an alert. SendAlert(alert action.Alert) }
State represents Lissio's view state.