Documentation
¶
Index ¶
- Variables
- func CalcMd5(s string) string
- func GetNacosConfigurationUniKey(namespace, group, dataId string) string
- func GetSyncStatusByDataId(statuses []nacosiov1.SyncStatus, dataId string) *nacosiov1.SyncStatus
- func RegisterObjectWrapper(targetGVK string, fn NewObjectWrapperFn)
- func RegisterObjectWrapperIfAbsent(targetGVK string, fn NewObjectWrapperFn)
- func RemoveSyncStatus(dc *nacosiov1.DynamicConfiguration, dataId string)
- func StringSliceContains(arr []string, item string) bool
- func UpdateSyncStatus(dc *nacosiov1.DynamicConfiguration, dataId, md5, from string, t metav1.Time, ...)
- func UpdateSyncStatusIfAbsent(dc *nacosiov1.DynamicConfiguration, dataId, md5, from string, t metav1.Time, ...)
- type ConfigMapWrapper
- func (cmw *ConfigMapWrapper) DeleteContent(dataId string) error
- func (cmw *ConfigMapWrapper) Flush() error
- func (cmw *ConfigMapWrapper) GetContent(dataId string) (string, bool, error)
- func (cmw *ConfigMapWrapper) InjectLabels(labels map[string]string)
- func (cmw *ConfigMapWrapper) Reload() error
- func (cmw *ConfigMapWrapper) StoreAllContent(dataMap map[string]string) (bool, error)
- func (cmw *ConfigMapWrapper) StoreContent(dataId string, content string) error
- type DataId2DCMappings
- func (d *DataId2DCMappings) AddMapping(namespaceId, group, dataId string, nn types.NamespacedName)
- func (d *DataId2DCMappings) GetDCList(namespaceId, group, dataId string) []types.NamespacedName
- func (d *DataId2DCMappings) HasMapping(namespaceId, group, dataId string, nn types.NamespacedName) bool
- func (d *DataId2DCMappings) RemoveMapping(namespaceId, group, dataId string, nn types.NamespacedName)
- type DefaultServer2ClusterCallback
- type LockManager
- type NewObjectWrapperFn
- type ObjectReferenceWrapper
- type Server2ClusterCallback
- type SyncConfigOptions
- type SyncConfigurationController
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ConfigMapGVK = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ConfigMap"}
)
Functions ¶
func GetSyncStatusByDataId ¶
func GetSyncStatusByDataId(statuses []nacosiov1.SyncStatus, dataId string) *nacosiov1.SyncStatus
func RegisterObjectWrapper ¶
func RegisterObjectWrapper(targetGVK string, fn NewObjectWrapperFn)
func RegisterObjectWrapperIfAbsent ¶
func RegisterObjectWrapperIfAbsent(targetGVK string, fn NewObjectWrapperFn)
func RemoveSyncStatus ¶
func RemoveSyncStatus(dc *nacosiov1.DynamicConfiguration, dataId string)
func StringSliceContains ¶
func UpdateSyncStatus ¶
Types ¶
type ConfigMapWrapper ¶
type ConfigMapWrapper struct { ObjectRef *v1.ObjectReference // contains filtered or unexported fields }
func (*ConfigMapWrapper) DeleteContent ¶
func (cmw *ConfigMapWrapper) DeleteContent(dataId string) error
func (*ConfigMapWrapper) Flush ¶
func (cmw *ConfigMapWrapper) Flush() error
func (*ConfigMapWrapper) GetContent ¶
func (cmw *ConfigMapWrapper) GetContent(dataId string) (string, bool, error)
func (*ConfigMapWrapper) InjectLabels ¶
func (cmw *ConfigMapWrapper) InjectLabels(labels map[string]string)
func (*ConfigMapWrapper) Reload ¶
func (cmw *ConfigMapWrapper) Reload() error
func (*ConfigMapWrapper) StoreAllContent ¶
func (cmw *ConfigMapWrapper) StoreAllContent(dataMap map[string]string) (bool, error)
func (*ConfigMapWrapper) StoreContent ¶
func (cmw *ConfigMapWrapper) StoreContent(dataId string, content string) error
type DataId2DCMappings ¶
type DataId2DCMappings struct {
// contains filtered or unexported fields
}
func NewDataId2DCMappings ¶
func NewDataId2DCMappings() *DataId2DCMappings
func (*DataId2DCMappings) AddMapping ¶
func (d *DataId2DCMappings) AddMapping(namespaceId, group, dataId string, nn types.NamespacedName)
func (*DataId2DCMappings) GetDCList ¶
func (d *DataId2DCMappings) GetDCList(namespaceId, group, dataId string) []types.NamespacedName
func (*DataId2DCMappings) HasMapping ¶
func (d *DataId2DCMappings) HasMapping(namespaceId, group, dataId string, nn types.NamespacedName) bool
func (*DataId2DCMappings) RemoveMapping ¶
func (d *DataId2DCMappings) RemoveMapping(namespaceId, group, dataId string, nn types.NamespacedName)
type DefaultServer2ClusterCallback ¶
type DefaultServer2ClusterCallback struct { client.Client // contains filtered or unexported fields }
func (*DefaultServer2ClusterCallback) Callback ¶
func (cb *DefaultServer2ClusterCallback) Callback(namespace, group, dataId, content string)
func (*DefaultServer2ClusterCallback) CallbackWithContext ¶
func (cb *DefaultServer2ClusterCallback) CallbackWithContext(ctx context.Context, namespace, group, dataId, content string)
type LockManager ¶
type LockManager struct {
// contains filtered or unexported fields
}
func NewLockManager ¶
func NewLockManager() *LockManager
func (*LockManager) DelLock ¶
func (lm *LockManager) DelLock(key string)
func (*LockManager) HasLock ¶
func (lm *LockManager) HasLock(key string) bool
type NewObjectWrapperFn ¶
type NewObjectWrapperFn func(*kubernetes.Clientset, client.Object, *v1.ObjectReference) (ObjectReferenceWrapper, error)
type ObjectReferenceWrapper ¶
type ObjectReferenceWrapper interface { //GetContent return content by dataId GetContent(dataId string) (string, bool, error) //StoreContent store content by dataId, return err if happened StoreContent(dataId string, content string) error //StoreAllContent store a map with dataId as key and content as value, return true if any content changed and error StoreAllContent(map[string]string) (bool, error) //DeleteContent remove a dataId DeleteContent(dataId string) error //InjectLabels to ObjectReference InjectLabels(map[string]string) //Flush write all content to ObjectReference Flush() error //Reload load ObjectReference, create it when not found Reload() error }
func NewObjectReferenceWrapper ¶
func NewObjectReferenceWrapper(cs *kubernetes.Clientset, owner client.Object, objRef *v1.ObjectReference) (ObjectReferenceWrapper, error)
type Server2ClusterCallback ¶
type Server2ClusterCallback interface { Callback(namespace, group, dataId, content string) CallbackWithContext(ctx context.Context, namespace, group, dataId, content string) }
func NewDefaultServer2ClusterCallback ¶
func NewDefaultServer2ClusterCallback(c client.Client, cs *kubernetes.Clientset, mappings *DataId2DCMappings, locks *LockManager) Server2ClusterCallback
type SyncConfigOptions ¶
type SyncConfigOptions struct { ConfigClient nacosclient.NacosConfigClient Callback Server2ClusterCallback Mappings *DataId2DCMappings Locks *LockManager }
type SyncConfigurationController ¶
type SyncConfigurationController struct {
// contains filtered or unexported fields
}
func NewSyncConfigurationController ¶
func NewSyncConfigurationController(c client.Client, cs *kubernetes.Clientset, opt SyncConfigOptions) *SyncConfigurationController
func (*SyncConfigurationController) Finalize ¶
func (scc *SyncConfigurationController) Finalize(ctx context.Context, dc *nacosiov1.DynamicConfiguration) error
func (*SyncConfigurationController) SyncDynamicConfiguration ¶
func (scc *SyncConfigurationController) SyncDynamicConfiguration(ctx context.Context, dc *nacosiov1.DynamicConfiguration) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.