api

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SettingsConfigMapName contains a name of config map, that stores settings.
	SettingsConfigMapName = "kubernetes-dashboard-settings"

	// SettingsConfigMapNamespace contains a namespace of config map, that stores settings.
	SettingsConfigMapNamespace = "kube-system"

	// 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"

	// 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"
)

Variables

This section is empty.

Functions

func GetDefaultSettingsConfigMap

func GetDefaultSettingsConfigMap() *corev1.ConfigMap

GetDefaultSettingsConfigMap returns config map with default settings.

Types

type Settings

type Settings struct {
	ClusterName             string `json:"clusterName"`
	ItemsPerPage            int    `json:"itemsPerPage"`
	AutoRefreshTimeInterval int    `json:"autoRefreshTimeInterval"`
}

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.

func Unmarshal

func Unmarshal(data string) (*Settings, error)

Unmarshal settings from JSON string into object.

func (Settings) Marshal

func (s Settings) Marshal() string

Marshal settings into JSON object.

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)
}

SettingsManager is used for user settings management.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL