Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SettingsConfigMapName contains a name of config map, that stores settings. SettingsConfigMapName = "kubernetes-dashboard-settings" // ConfigMapKindName is a name of config map kind. ConfigMapKindName = "ConfigMap" // ConfigMapAPIVersion is a API version of config map. ConfigMapAPIVersion = "v1" // GlobalSettingsKey is a settings map key which maps to current global settings. GlobalSettingsKey = "_global" // PinnedResourcesKey is a settings map key which maps to current pinned resources. PinnedResourcesKey = "_pinnedCRD" // ConcurrentSettingsChangeError occurs during settings save if settings were modified concurrently. // Keep it in sync with CONCURRENT_CHANGE_ERROR constant from the frontend. ConcurrentSettingsChangeError = "settings changed since last reload" // PinnedResourceNotFoundError occurs while deleting pinned resource, if the resource wasn't already pinned. PinnedResourceNotFoundError = "pinned resource not found" // ResourceAlreadyPinnedError occurs while pinning a new resource, if it has been pinned before. ResourceAlreadyPinnedError = "resource already pinned" )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultSettingsConfigMap ¶
GetDefaultSettingsConfigMap returns config map with default settings.
func MarshalPinnedResources ¶
func MarshalPinnedResources(p []PinnedResource) string
MarshalPinnedResources pinned resource into JSON object.
func UnmarshalPinnedResources ¶
func UnmarshalPinnedResources(data string) (*[]PinnedResource, error)
UnmarshalPinnedResources unmarshal pinned resource into object.
Types ¶
type PinnedResource ¶
type PinnedResource struct { Kind string `json:"kind"` Name string `json:"name"` DisplayName string `json:"displayName"` Namespace string `json:"namespace,omitempty"` Namespaced bool `json:"namespaced"` }
PinnedResource represents a pinned resource.
func (*PinnedResource) IsEqual ¶
func (p *PinnedResource) IsEqual(other *PinnedResource) bool
type Settings ¶
type Settings struct { ClusterName string `json:"clusterName"` ItemsPerPage int `json:"itemsPerPage"` LogsAutoRefreshTimeInterval int `json:"logsAutoRefreshTimeInterval"` ResourceAutoRefreshTimeInterval int `json:"resourceAutoRefreshTimeInterval"` DisableAccessDeniedNotifications bool `json:"disableAccessDeniedNotifications"` }
Settings is a single instance of settings without context.
func GetDefaultSettings ¶
func GetDefaultSettings() Settings
GetDefaultSettings returns settings structure, that should be used if there are no global or local settings overriding them. It should not change during runtime.
type SettingsManager ¶
type SettingsManager interface { // GetGlobalSettings gets current global settings from config map. GetGlobalSettings(client kubernetes.Interface) (s Settings) // SaveGlobalSettings saves provided global settings in config map. SaveGlobalSettings(client kubernetes.Interface, s *Settings) error // GetPinnedResources gets the pinned resources from config map. GetPinnedResources(client kubernetes.Interface) (r []PinnedResource) // SavePinnedResource adds a new pinned resource to config map. SavePinnedResource(client kubernetes.Interface, r *PinnedResource) error // DeletePinnedResource removes a pinned resource from config map. DeletePinnedResource(client kubernetes.Interface, r *PinnedResource) error }
SettingsManager is used for user settings management.
Click to show internal directories.
Click to hide internal directories.