Documentation
¶
Index ¶
- Constants
- func DecodeConfigFormat(data []map[string]string) (map[string]string, error)
- func EncodeConfigFormat(key, value string) map[string]string
- func GenConfigMapName(appName, serviceName, configName string) string
- func ToConfigMap(s Store, name, envName string, configData map[string]string) (*v1.ConfigMap, error)
- type Configmap
- type Fake
- type Local
- type Store
Constants ¶
const (
// Splitter is a splitter for configmap name generation
Splitter = "-"
// TypeConfigMap defines the type of Configmap
TypeConfigMap = "configmap"
)
const TypeFake = "fake"
TypeFake is a fake type
const TypeLocal = "local"
TypeLocal defines the local config store type
Variables ¶
This section is empty.
Functions ¶
func DecodeConfigFormat ¶
func DecodeConfigFormat(data []map[string]string) (map[string]string, error)
DecodeConfigFormat will decode config{name: key, value: value} format to key-value mode.
func EncodeConfigFormat ¶
func EncodeConfigFormat(key, value string) map[string]string
EncodeConfigFormat will encode key-value to config{name: key, value: value} format
func GenConfigMapName ¶
func GenConfigMapName(appName, serviceName, configName string) string
GenConfigMapName is a fixed way to name the configmap name for appfile config
func ToConfigMap ¶
func ToConfigMap(s Store, name, envName string, configData map[string]string) (*v1.ConfigMap, error)
ToConfigMap will get the data of the store and upload to configmap. Serverside Application controller can only use the config in appfile context by configmap.
Types ¶
type Configmap ¶
type Configmap struct {
Client client.Client
}
Configmap is the configmap implementation of config store
func (*Configmap) GetConfigData ¶
func (f *Configmap) GetConfigData(name, envName string) ([]map[string]string, error)
GetConfigData will get config data from configmap
type Fake ¶
type Fake struct {
Data []map[string]string
}
Fake is a fake implementation of config store, help for test
func (*Fake) GetConfigData ¶
func (f *Fake) GetConfigData(_ string, _ string) ([]map[string]string, error)
GetConfigData get data
type Local ¶
type Local struct{}
Local is the local implementation of config store
func (*Local) GetConfigData ¶
func (l *Local) GetConfigData(configName, envName string) ([]map[string]string, error)
GetConfigData will return config data from local