Documentation ¶
Index ¶
- Variables
- type ConfigMap
- type ConfigMapManager
- func (s *ConfigMapManager) Delete(nameOrID string) (string, error)
- func (s *ConfigMapManager) List() ([]ConfigMap, error)
- func (s *ConfigMapManager) Lookup(nameOrID string) (*ConfigMap, error)
- func (s *ConfigMapManager) LookupConfigMapData(nameOrID string) (*ConfigMap, []byte, error)
- func (s *ConfigMapManager) Store(name string, data []byte, driverType string, driverOpts map[string]string) (string, error)
- type ConfigMapsDriver
Constants ¶
This section is empty.
Variables ¶
var ErrNoSuchConfigMap = errors.New("no such configmap")
ErrNoSuchConfigMap indicates that the configMap does not exist
Functions ¶
This section is empty.
Types ¶
type ConfigMap ¶
type ConfigMap struct { // Name is the name of the configmap Name string `json:"name"` // ID is the unique configMap ID ID string `json:"id"` // Metadata stores other metadata on the configMap Metadata map[string]string `json:"metadata,omitempty"` // CreatedAt is when the configMap was created CreatedAt time.Time `json:"createdAt"` // Driver is the driver used to store configMap data Driver string `json:"driver"` // DriverOptions is other metadata needed to use the driver DriverOptions map[string]string `json:"driverOptions"` }
ConfigMap defines a configMap
type ConfigMapManager ¶
type ConfigMapManager struct {
// contains filtered or unexported fields
}
ConfigMapManager holds information on handling configmaps
func NewManager ¶
func NewManager(rootPath string) (*ConfigMapManager, error)
NewManager creates a new configMaps manager rootPath is the directory where the configMaps data file resides
func (*ConfigMapManager) Delete ¶
func (s *ConfigMapManager) Delete(nameOrID string) (string, error)
Delete removes all configMap metadata and configMap data associated with the specified configMap. Delete takes a name, ID, or partial ID.
func (*ConfigMapManager) List ¶
func (s *ConfigMapManager) List() ([]ConfigMap, error)
List lists all configMaps.
func (*ConfigMapManager) Lookup ¶
func (s *ConfigMapManager) Lookup(nameOrID string) (*ConfigMap, error)
Lookup gives a configMap's metadata given its name, ID, or partial ID.
func (*ConfigMapManager) LookupConfigMapData ¶
func (s *ConfigMapManager) LookupConfigMapData(nameOrID string) (*ConfigMap, []byte, error)
LookupConfigMapData returns configMap metadata as well as configMap data in bytes. The configMap data can be looked up using its name, ID, or partial ID.
func (*ConfigMapManager) Store ¶
func (s *ConfigMapManager) Store(name string, data []byte, driverType string, driverOpts map[string]string) (string, error)
Store takes a name, creates a configMap and stores the configMap metadata and the configMap payload. It returns a generated ID that is associated with the configMap. The max size for configMap data is 512kB.
type ConfigMapsDriver ¶
type ConfigMapsDriver interface { // List lists all configMap ids in the configMaps data store List() ([]string, error) // Lookup gets the configMap's data bytes Lookup(id string) ([]byte, error) // Store stores the configMap's data bytes Store(id string, data []byte) error // Delete deletes a configMap's data from the driver Delete(id string) error }
ConfigMapsDriver interfaces with the configMaps data store. The driver stores the actual bytes of configMap data, as opposed to the configMap metadata.
revive does not like the name because the package is already called configmaps