Documentation ¶
Index ¶
- Constants
- func CalMd5(content string) string
- func CheckContentLength(content string, max int) error
- func CheckFileName(name *wrappers.StringValue) error
- func CompareByVersion(clientInfo *apiconfig.ClientConfigFileInfo, file *model.ConfigFileRelease) bool
- func CompressConfigFiles(files []*model.ConfigFile, fileID2Tags map[uint64][]*model.ConfigFileTag, ...) (*bytes.Buffer, error)
- func GetChainOrder() []string
- func Initialize(ctx context.Context, config Config, s store.Store, ...) error
- func NewWatchCenter(cacheMgr cachetypes.CacheManager) (*watchCenter, error)
- func RegisterServerProxy(name string, factor ServerProxyFactory) error
- func TestCompareByVersion(clientInfo *apiconfig.ClientConfigFileInfo, file *model.ConfigFileRelease) bool
- func TestInitialize(ctx context.Context, config Config, s store.Store, ...) (ConfigCenterServer, *Server, error)
- type BetaReleaseMatcher
- type CompareFunction
- type Config
- type ConfigCenterServer
- type ConfigChains
- func (cc *ConfigChains) AfterGetFile(ctx context.Context, file *model.ConfigFile) (*model.ConfigFile, error)
- func (cc *ConfigChains) AfterGetFileHistory(ctx context.Context, history *model.ConfigFileReleaseHistory) (*model.ConfigFileReleaseHistory, error)
- func (cc *ConfigChains) AfterGetFileRelease(ctx context.Context, release *model.ConfigFileRelease) (*model.ConfigFileRelease, error)
- func (cc *ConfigChains) BeforeCreateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
- func (cc *ConfigChains) BeforeUpdateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
- type ConfigFileChain
- type ConfigFileClientOperate
- type ConfigFileGroupOperate
- type ConfigFileOperate
- type ConfigFileReleaseOperate
- type ConfigFileTemplateOperate
- type CryptoConfigFileChain
- func (chain *CryptoConfigFileChain) AfterGetFile(ctx context.Context, file *model.ConfigFile) (*model.ConfigFile, error)
- func (chain *CryptoConfigFileChain) AfterGetFileHistory(ctx context.Context, history *model.ConfigFileReleaseHistory) (*model.ConfigFileReleaseHistory, error)
- func (chain *CryptoConfigFileChain) AfterGetFileRelease(ctx context.Context, release *model.ConfigFileRelease) (*model.ConfigFileRelease, error)
- func (chain *CryptoConfigFileChain) BeforeCreateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
- func (chain *CryptoConfigFileChain) BeforeUpdateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
- func (chain *CryptoConfigFileChain) Init(svr *Server)
- func (chain *CryptoConfigFileChain) Name() string
- type FileReleaseCallback
- type LongPollWatchContext
- func (c *LongPollWatchContext) AppendInterest(item *apiconfig.ClientConfigFileInfo)
- func (c *LongPollWatchContext) ClientID() string
- func (c *LongPollWatchContext) ClientLabels() map[string]string
- func (c *LongPollWatchContext) Close() error
- func (c *LongPollWatchContext) GetNotifieResult() *apiconfig.ConfigClientResponse
- func (c *LongPollWatchContext) GetNotifieResultWithTime(timeout time.Duration) (*apiconfig.ConfigClientResponse, error)
- func (c *LongPollWatchContext) IsOnce() bool
- func (c *LongPollWatchContext) ListWatchFiles() []*apiconfig.ClientConfigFileInfo
- func (c *LongPollWatchContext) RemoveInterest(item *apiconfig.ClientConfigFileInfo)
- func (c *LongPollWatchContext) Reply(rsp *apiconfig.ConfigClientResponse)
- func (c *LongPollWatchContext) ShouldExpire(now time.Time) bool
- func (c *LongPollWatchContext) ShouldNotify(event *model.SimpleConfigFileRelease) bool
- type ReleaseConfigFileChain
- func (chain *ReleaseConfigFileChain) AfterGetFile(ctx context.Context, file *model.ConfigFile) (*model.ConfigFile, error)
- func (chain *ReleaseConfigFileChain) AfterGetFileHistory(ctx context.Context, history *model.ConfigFileReleaseHistory) (*model.ConfigFileReleaseHistory, error)
- func (chain *ReleaseConfigFileChain) AfterGetFileRelease(ctx context.Context, ret *model.ConfigFileRelease) (*model.ConfigFileRelease, error)
- func (chain *ReleaseConfigFileChain) BeforeCreateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
- func (chain *ReleaseConfigFileChain) BeforeUpdateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
- func (chain *ReleaseConfigFileChain) Init(svr *Server)
- func (chain *ReleaseConfigFileChain) Name() string
- type ResourceEvent
- type ResourceHook
- type Server
- func (s *Server) BatchDeleteConfigFile(ctx context.Context, req []*apiconfig.ConfigFile) *apiconfig.ConfigResponse
- func (s *Server) CacheManager() cachetypes.CacheManager
- func (s *Server) CasUpsertAndReleaseConfigFile(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse
- func (s *Server) CasUpsertAndReleaseConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse
- func (s *Server) CreateConfigFile(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
- func (s *Server) CreateConfigFileFromClient(ctx context.Context, client *apiconfig.ConfigFile) *apiconfig.ConfigClientResponse
- func (s *Server) CreateConfigFileGroup(ctx context.Context, req *apiconfig.ConfigFileGroup) *apiconfig.ConfigResponse
- func (s *Server) CreateConfigFileTemplate(ctx context.Context, template *apiconfig.ConfigFileTemplate) *apiconfig.ConfigResponse
- func (s *Server) CryptoManager() plugin.CryptoManager
- func (s *Server) DeleteConfigFile(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
- func (s *Server) DeleteConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
- func (s *Server) DeleteConfigFileGroup(ctx context.Context, namespace, name string) *apiconfig.ConfigResponse
- func (s *Server) DeleteConfigFileReleases(ctx context.Context, reqs []*apiconfig.ConfigFileRelease) *apiconfig.ConfigBatchWriteResponse
- func (s *Server) ExportConfigFile(ctx context.Context, configFileExport *apiconfig.ConfigFileExportRequest) *apiconfig.ConfigExportResponse
- func (s *Server) FileCache() cachetypes.ConfigFileCache
- func (s *Server) GetAllConfigEncryptAlgorithms(ctx context.Context) *apiconfig.ConfigEncryptAlgorithmResponse
- func (s *Server) GetAllConfigFileTemplates(ctx context.Context) *apiconfig.ConfigBatchQueryResponse
- func (s *Server) GetConfigFileNamesWithCache(ctx context.Context, req *apiconfig.ConfigFileGroupRequest) *apiconfig.ConfigClientListResponse
- func (s *Server) GetConfigFileRelease(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse
- func (s *Server) GetConfigFileReleaseHistories(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse
- func (s *Server) GetConfigFileReleaseVersions(ctx context.Context, filters map[string]string) *apiconfig.ConfigBatchQueryResponse
- func (s *Server) GetConfigFileReleases(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse
- func (s *Server) GetConfigFileRichInfo(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
- func (s *Server) GetConfigFileTemplate(ctx context.Context, name string) *apiconfig.ConfigResponse
- func (s *Server) GetConfigFileWithCache(ctx context.Context, req *apiconfig.ClientConfigFileInfo) *apiconfig.ConfigClientResponse
- func (s *Server) GetConfigGroupsWithCache(ctx context.Context, req *apiconfig.ClientConfigFileInfo) *apiconfig.ConfigDiscoverResponse
- func (s *Server) GroupCache() cachetypes.ConfigGroupCache
- func (s *Server) ImportConfigFile(ctx context.Context, configFiles []*apiconfig.ConfigFile, ...) *apiconfig.ConfigImportResponse
- func (s *Server) LongPullWatchFile(ctx context.Context, req *apiconfig.ClientWatchConfigFileRequest) (WatchCallback, error)
- func (s *Server) PublishConfigFile(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse
- func (s *Server) PublishConfigFileFromClient(ctx context.Context, client *apiconfig.ConfigFileRelease) *apiconfig.ConfigClientResponse
- func (s *Server) QueryConfigFileGroups(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse
- func (s *Server) RecordHistory(ctx context.Context, entry *model.RecordEntry)
- func (s *Server) RollbackConfigFileRelease(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse
- func (s *Server) RollbackConfigFileReleases(ctx context.Context, reqs []*apiconfig.ConfigFileRelease) *apiconfig.ConfigBatchWriteResponse
- func (s *Server) SearchConfigFile(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse
- func (s *Server) SetResourceHooks(hooks ...ResourceHook)
- func (s *Server) StopGrayConfigFileRelease(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse
- func (s *Server) StopGrayConfigFileReleases(ctx context.Context, reqs []*apiconfig.ConfigFileRelease) *apiconfig.ConfigBatchWriteResponse
- func (s *Server) TestCheckClientConfigFile(ctx context.Context, files []*apiconfig.ClientConfigFileInfo, ...) (*apiconfig.ConfigClientResponse, bool)
- func (s *Server) TestDecryptConfigFile(ctx context.Context, configFile *model.ConfigFile) (err error)
- func (s *Server) TestEncryptConfigFile(ctx context.Context, configFile *model.ConfigFile, algorithm string, ...) error
- func (s *Server) TestMockCryptoManager(mgr plugin.CryptoManager)
- func (s *Server) TestMockStore(ms store.Store)
- func (s *Server) UpdateConfigFile(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
- func (s *Server) UpdateConfigFileFromClient(ctx context.Context, client *apiconfig.ConfigFile) *apiconfig.ConfigClientResponse
- func (s *Server) UpdateConfigFileGroup(ctx context.Context, req *apiconfig.ConfigFileGroup) *apiconfig.ConfigResponse
- func (s *Server) UpsertAndReleaseConfigFile(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse
- func (s *Server) UpsertAndReleaseConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse
- func (s *Server) WatchCenter() *watchCenter
- type ServerProxyFactory
- type WatchCallback
- type WatchContext
- type WatchContextFactory
Constants ¶
const (
// MaxPageSize 最大分页大小
MaxPageSize = 100
)
const (
QueueSize = 10240
)
Variables ¶
This section is empty.
Functions ¶
func CheckContentLength ¶ added in v1.17.3
CheckContentLength 校验文件内容长度
func CheckFileName ¶ added in v1.17.3
func CheckFileName(name *wrappers.StringValue) error
CheckFileName 校验文件名
func CompareByVersion ¶ added in v1.18.0
func CompareByVersion(clientInfo *apiconfig.ClientConfigFileInfo, file *model.ConfigFileRelease) bool
func CompressConfigFiles ¶ added in v1.17.3
func CompressConfigFiles(files []*model.ConfigFile, fileID2Tags map[uint64][]*model.ConfigFileTag, isExportGroup bool) (*bytes.Buffer, error)
func GetChainOrder ¶ added in v1.18.0
func GetChainOrder() []string
func Initialize ¶
func Initialize(ctx context.Context, config Config, s store.Store, cacheMgr cachetypes.CacheManager, namespaceOperator namespace.NamespaceOperateServer) error
Initialize 初始化配置中心模块
func NewWatchCenter ¶
func NewWatchCenter(cacheMgr cachetypes.CacheManager) (*watchCenter, error)
NewWatchCenter 创建一个客户端监听配置发布的处理中心
func RegisterServerProxy ¶ added in v1.18.0
func RegisterServerProxy(name string, factor ServerProxyFactory) error
func TestCompareByVersion ¶ added in v1.17.3
func TestCompareByVersion(clientInfo *apiconfig.ClientConfigFileInfo, file *model.ConfigFileRelease) bool
func TestInitialize ¶ added in v1.17.3
func TestInitialize(ctx context.Context, config Config, s store.Store, cacheMgn *cache.CacheManager, namespaceOperator namespace.NamespaceOperateServer, userMgn auth.UserServer, strategyMgn auth.StrategyServer) (ConfigCenterServer, *Server, error)
Initialize 初始化配置中心模块
Types ¶
type BetaReleaseMatcher ¶ added in v1.18.0
type BetaReleaseMatcher func(clientLabels map[string]string, event *model.SimpleConfigFileRelease) bool
type CompareFunction ¶ added in v1.18.0
type CompareFunction func(clientInfo *apiconfig.ClientConfigFileInfo, file *model.ConfigFileRelease) bool
type Config ¶
type Config struct { Open bool `yaml:"open"` ContentMaxLength int64 `yaml:"contentMaxLength"` Interceptors []string `yaml:"-"` }
Config 配置中心模块启动参数
type ConfigCenterServer ¶
type ConfigCenterServer interface { ConfigFileGroupOperate ConfigFileOperate ConfigFileReleaseOperate ConfigFileClientOperate ConfigFileTemplateOperate }
ConfigCenterServer 配置中心server
type ConfigChains ¶ added in v1.17.3
type ConfigChains struct {
// contains filtered or unexported fields
}
func (*ConfigChains) AfterGetFile ¶ added in v1.17.3
func (cc *ConfigChains) AfterGetFile(ctx context.Context, file *model.ConfigFile) (*model.ConfigFile, error)
AfterGetFile
func (*ConfigChains) AfterGetFileHistory ¶ added in v1.17.3
func (cc *ConfigChains) AfterGetFileHistory(ctx context.Context, history *model.ConfigFileReleaseHistory) (*model.ConfigFileReleaseHistory, error)
AfterGetFileHistory
func (*ConfigChains) AfterGetFileRelease ¶ added in v1.17.3
func (cc *ConfigChains) AfterGetFileRelease(ctx context.Context, release *model.ConfigFileRelease) (*model.ConfigFileRelease, error)
AfterGetFileRelease
func (*ConfigChains) BeforeCreateFile ¶ added in v1.17.3
func (cc *ConfigChains) BeforeCreateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
BeforeCreateFile
func (*ConfigChains) BeforeUpdateFile ¶ added in v1.17.3
func (cc *ConfigChains) BeforeUpdateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
BeforeUpdateFile
type ConfigFileChain ¶ added in v1.17.3
type ConfigFileChain interface { // Init Init(svr *Server) // Name Name() string // BeforeCreateFile BeforeCreateFile(context.Context, *model.ConfigFile) *apiconfig.ConfigResponse // AfterGetFile AfterGetFile(context.Context, *model.ConfigFile) (*model.ConfigFile, error) // BeforeUpdateFile BeforeUpdateFile(context.Context, *model.ConfigFile) *apiconfig.ConfigResponse // AfterGetFileRelease AfterGetFileRelease(context.Context, *model.ConfigFileRelease) (*model.ConfigFileRelease, error) // AfterGetFileHistory AfterGetFileHistory(context.Context, *model.ConfigFileReleaseHistory) (*model.ConfigFileReleaseHistory, error) }
ConfigFileChain
type ConfigFileClientOperate ¶
type ConfigFileClientOperate interface { // CreateConfigFileFromClient 调用config_file的方法创建配置文件 CreateConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigClientResponse // UpdateConfigFileFromClient 调用config_file的方法更新配置文件 UpdateConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigClientResponse // DeleteConfigFileFromClient 调用config_file的方法更新配置文件 DeleteConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse // PublishConfigFileFromClient 调用config_file_release的方法发布配置文件 PublishConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigClientResponse // UpsertAndReleaseConfigFile 创建/更新配置文件并发布 UpsertAndReleaseConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse // CasUpsertAndReleaseConfigFileFromClient 创建/更新配置文件并发布 CasUpsertAndReleaseConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse // LongPullWatchFile 客户端监听配置文件 LongPullWatchFile(ctx context.Context, req *apiconfig.ClientWatchConfigFileRequest) (WatchCallback, error) // GetConfigFileNamesWithCache 获取某个配置分组下的配置文件 GetConfigFileNamesWithCache(ctx context.Context, req *apiconfig.ConfigFileGroupRequest) *apiconfig.ConfigClientListResponse // GetConfigFileWithCache 获取配置文件 GetConfigFileWithCache(ctx context.Context, req *apiconfig.ClientConfigFileInfo) *apiconfig.ConfigClientResponse // GetConfigGroupsWithCache 获取某个命名空间下的配置分组列表 GetConfigGroupsWithCache(ctx context.Context, req *apiconfig.ClientConfigFileInfo) *apiconfig.ConfigDiscoverResponse }
ConfigFileClientOperate 给客户端提供服务接口,不同的上层协议抽象的公共服务逻辑
type ConfigFileGroupOperate ¶
type ConfigFileGroupOperate interface { // CreateConfigFileGroup 创建配置文件组 CreateConfigFileGroup(ctx context.Context, configFileGroup *apiconfig.ConfigFileGroup) *apiconfig.ConfigResponse // QueryConfigFileGroups 查询配置文件组 QueryConfigFileGroups(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse // DeleteConfigFileGroup 删除配置文件组 DeleteConfigFileGroup(ctx context.Context, namespace, name string) *apiconfig.ConfigResponse // UpdateConfigFileGroup 更新配置文件组 UpdateConfigFileGroup(ctx context.Context, configFileGroup *apiconfig.ConfigFileGroup) *apiconfig.ConfigResponse }
ConfigFileGroupOperate 配置文件组接口
type ConfigFileOperate ¶
type ConfigFileOperate interface { // CreateConfigFile 创建配置文件 CreateConfigFile(ctx context.Context, configFile *apiconfig.ConfigFile) *apiconfig.ConfigResponse // GetConfigFileRichInfo 获取单个配置文件基础信息,包含发布状态等信息 GetConfigFileRichInfo(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse // SearchConfigFile 按 group 和 name 模糊搜索配置文件 SearchConfigFile(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse // UpdateConfigFile 更新配置文件 UpdateConfigFile(ctx context.Context, configFile *apiconfig.ConfigFile) *apiconfig.ConfigResponse // DeleteConfigFile 删除配置文件 DeleteConfigFile(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse // BatchDeleteConfigFile 批量删除配置文件 BatchDeleteConfigFile(ctx context.Context, req []*apiconfig.ConfigFile) *apiconfig.ConfigResponse // ExportConfigFile 导出配置文件 ExportConfigFile(ctx context.Context, configFileExport *apiconfig.ConfigFileExportRequest) *apiconfig.ConfigExportResponse // ImportConfigFile 导入配置文件 ImportConfigFile(ctx context.Context, configFiles []*apiconfig.ConfigFile, conflictHandling string) *apiconfig.ConfigImportResponse // GetAllConfigEncryptAlgorithms 获取配置加密算法 GetAllConfigEncryptAlgorithms(ctx context.Context) *apiconfig.ConfigEncryptAlgorithmResponse }
ConfigFileOperate 配置文件接口
type ConfigFileReleaseOperate ¶
type ConfigFileReleaseOperate interface { // PublishConfigFile 发布配置文件 PublishConfigFile(ctx context.Context, configFileRelease *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse // GetConfigFileRelease 获取配置文件发布 GetConfigFileRelease(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse // DeleteConfigFileReleases 删除配置文件发布内容 DeleteConfigFileReleases(ctx context.Context, reqs []*apiconfig.ConfigFileRelease) *apiconfig.ConfigBatchWriteResponse // RollbackConfigFileReleases 批量回滚配置到指定版本 RollbackConfigFileReleases(ctx context.Context, releases []*apiconfig.ConfigFileRelease) *apiconfig.ConfigBatchWriteResponse // GetConfigFileReleases 查询所有的配置发布版本信息 GetConfigFileReleases(ctx context.Context, filters map[string]string) *apiconfig.ConfigBatchQueryResponse // GetConfigFileReleaseVersions 查询所有的配置发布版本信息 GetConfigFileReleaseVersions(ctx context.Context, filters map[string]string) *apiconfig.ConfigBatchQueryResponse // GetConfigFileReleaseHistories 获取配置文件的发布历史 GetConfigFileReleaseHistories(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse // UpsertAndReleaseConfigFile 创建/更新配置文件并发布 UpsertAndReleaseConfigFile(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse // StopGrayConfigFileReleases 停止所有的灰度发布配置 StopGrayConfigFileReleases(ctx context.Context, reqs []*apiconfig.ConfigFileRelease) *apiconfig.ConfigBatchWriteResponse }
ConfigFileReleaseOperate 配置文件发布接口
type ConfigFileTemplateOperate ¶
type ConfigFileTemplateOperate interface { // GetAllConfigFileTemplates get all config file templates GetAllConfigFileTemplates(ctx context.Context) *apiconfig.ConfigBatchQueryResponse // CreateConfigFileTemplate create config file template CreateConfigFileTemplate(ctx context.Context, template *apiconfig.ConfigFileTemplate) *apiconfig.ConfigResponse // GetConfigFileTemplate get config file template GetConfigFileTemplate(ctx context.Context, name string) *apiconfig.ConfigResponse }
ConfigFileTemplateOperate config file template operate
type CryptoConfigFileChain ¶ added in v1.17.3
type CryptoConfigFileChain struct {
// contains filtered or unexported fields
}
func (*CryptoConfigFileChain) AfterGetFile ¶ added in v1.17.3
func (chain *CryptoConfigFileChain) AfterGetFile(ctx context.Context, file *model.ConfigFile) (*model.ConfigFile, error)
AfterCreateFile
func (*CryptoConfigFileChain) AfterGetFileHistory ¶ added in v1.17.3
func (chain *CryptoConfigFileChain) AfterGetFileHistory(ctx context.Context, history *model.ConfigFileReleaseHistory) (*model.ConfigFileReleaseHistory, error)
AfterGetFileHistory
func (*CryptoConfigFileChain) AfterGetFileRelease ¶ added in v1.17.3
func (chain *CryptoConfigFileChain) AfterGetFileRelease(ctx context.Context, release *model.ConfigFileRelease) (*model.ConfigFileRelease, error)
AfterGetFileRelease
func (*CryptoConfigFileChain) BeforeCreateFile ¶ added in v1.17.3
func (chain *CryptoConfigFileChain) BeforeCreateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
BeforeCreateFile
func (*CryptoConfigFileChain) BeforeUpdateFile ¶ added in v1.17.3
func (chain *CryptoConfigFileChain) BeforeUpdateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
BeforeUpdateFile
func (*CryptoConfigFileChain) Init ¶ added in v1.17.3
func (chain *CryptoConfigFileChain) Init(svr *Server)
func (*CryptoConfigFileChain) Name ¶ added in v1.17.3
func (chain *CryptoConfigFileChain) Name() string
type FileReleaseCallback ¶
type FileReleaseCallback func(clientId string, rsp *apiconfig.ConfigClientResponse) bool
type LongPollWatchContext ¶ added in v1.18.0
type LongPollWatchContext struct {
// contains filtered or unexported fields
}
func (*LongPollWatchContext) AppendInterest ¶ added in v1.18.0
func (c *LongPollWatchContext) AppendInterest(item *apiconfig.ClientConfigFileInfo)
AppendInterest .
func (*LongPollWatchContext) ClientID ¶ added in v1.18.0
func (c *LongPollWatchContext) ClientID() string
ClientID .
func (*LongPollWatchContext) ClientLabels ¶ added in v1.18.0
func (c *LongPollWatchContext) ClientLabels() map[string]string
func (*LongPollWatchContext) Close ¶ added in v1.18.0
func (c *LongPollWatchContext) Close() error
Close .
func (*LongPollWatchContext) GetNotifieResult ¶ added in v1.18.0
func (c *LongPollWatchContext) GetNotifieResult() *apiconfig.ConfigClientResponse
func (*LongPollWatchContext) GetNotifieResultWithTime ¶ added in v1.18.0
func (c *LongPollWatchContext) GetNotifieResultWithTime(timeout time.Duration) (*apiconfig.ConfigClientResponse, error)
func (*LongPollWatchContext) IsOnce ¶ added in v1.18.0
func (c *LongPollWatchContext) IsOnce() bool
IsOnce
func (*LongPollWatchContext) ListWatchFiles ¶ added in v1.18.0
func (c *LongPollWatchContext) ListWatchFiles() []*apiconfig.ClientConfigFileInfo
func (*LongPollWatchContext) RemoveInterest ¶ added in v1.18.0
func (c *LongPollWatchContext) RemoveInterest(item *apiconfig.ClientConfigFileInfo)
RemoveInterest .
func (*LongPollWatchContext) Reply ¶ added in v1.18.0
func (c *LongPollWatchContext) Reply(rsp *apiconfig.ConfigClientResponse)
func (*LongPollWatchContext) ShouldExpire ¶ added in v1.18.0
func (c *LongPollWatchContext) ShouldExpire(now time.Time) bool
func (*LongPollWatchContext) ShouldNotify ¶ added in v1.18.0
func (c *LongPollWatchContext) ShouldNotify(event *model.SimpleConfigFileRelease) bool
type ReleaseConfigFileChain ¶ added in v1.17.3
type ReleaseConfigFileChain struct {
// contains filtered or unexported fields
}
func (*ReleaseConfigFileChain) AfterGetFile ¶ added in v1.17.3
func (chain *ReleaseConfigFileChain) AfterGetFile(ctx context.Context, file *model.ConfigFile) (*model.ConfigFile, error)
AfterCreateFile
func (*ReleaseConfigFileChain) AfterGetFileHistory ¶ added in v1.17.3
func (chain *ReleaseConfigFileChain) AfterGetFileHistory(ctx context.Context, history *model.ConfigFileReleaseHistory) (*model.ConfigFileReleaseHistory, error)
AfterGetFileHistory
func (*ReleaseConfigFileChain) AfterGetFileRelease ¶ added in v1.17.3
func (chain *ReleaseConfigFileChain) AfterGetFileRelease(ctx context.Context, ret *model.ConfigFileRelease) (*model.ConfigFileRelease, error)
AfterGetFileRelease
func (*ReleaseConfigFileChain) BeforeCreateFile ¶ added in v1.17.3
func (chain *ReleaseConfigFileChain) BeforeCreateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
BeforeCreateFile
func (*ReleaseConfigFileChain) BeforeUpdateFile ¶ added in v1.17.3
func (chain *ReleaseConfigFileChain) BeforeUpdateFile(ctx context.Context, file *model.ConfigFile) *apiconfig.ConfigResponse
BeforeUpdateFile
func (*ReleaseConfigFileChain) Init ¶ added in v1.17.3
func (chain *ReleaseConfigFileChain) Init(svr *Server)
func (*ReleaseConfigFileChain) Name ¶ added in v1.17.3
func (chain *ReleaseConfigFileChain) Name() string
type ResourceEvent ¶
type ResourceEvent struct {
ConfigGroup *apiconfig.ConfigFileGroup
}
ResourceEvent 资源事件
type ResourceHook ¶
type ResourceHook interface { // Before Before(ctx context.Context, resourceType model.Resource) // After After(ctx context.Context, resourceType model.Resource, res *ResourceEvent) error }
ResourceHook The listener is placed before and after the resource operation, only normal flow
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server 配置中心核心服务
func GetOriginServer ¶
func (*Server) BatchDeleteConfigFile ¶
func (s *Server) BatchDeleteConfigFile(ctx context.Context, req []*apiconfig.ConfigFile) *apiconfig.ConfigResponse
BatchDeleteConfigFile 批量删除配置文件
func (*Server) CacheManager ¶ added in v1.18.0
func (s *Server) CacheManager() cachetypes.CacheManager
func (*Server) CasUpsertAndReleaseConfigFile ¶ added in v1.18.0
func (s *Server) CasUpsertAndReleaseConfigFile(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse
CasUpsertAndReleaseConfigFile 根据版本比对决定是否允许进行配置修改发布
func (*Server) CasUpsertAndReleaseConfigFileFromClient ¶ added in v1.18.0
func (s *Server) CasUpsertAndReleaseConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse
CasUpsertAndReleaseConfigFileFromClient 创建/更新配置文件并发布
func (*Server) CreateConfigFile ¶
func (s *Server) CreateConfigFile(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
CreateConfigFile 创建配置文件
func (*Server) CreateConfigFileFromClient ¶ added in v1.17.2
func (s *Server) CreateConfigFileFromClient(ctx context.Context, client *apiconfig.ConfigFile) *apiconfig.ConfigClientResponse
CreateConfigFileFromClient 调用config_file接口获取配置文件
func (*Server) CreateConfigFileGroup ¶
func (s *Server) CreateConfigFileGroup(ctx context.Context, req *apiconfig.ConfigFileGroup) *apiconfig.ConfigResponse
CreateConfigFileGroup 创建配置文件组
func (*Server) CreateConfigFileTemplate ¶
func (s *Server) CreateConfigFileTemplate( ctx context.Context, template *apiconfig.ConfigFileTemplate) *apiconfig.ConfigResponse
CreateConfigFileTemplate create config file template
func (*Server) CryptoManager ¶ added in v1.17.3
func (s *Server) CryptoManager() plugin.CryptoManager
CryptoManager 获取加密管理
func (*Server) DeleteConfigFile ¶
func (s *Server) DeleteConfigFile(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
DeleteConfigFile 删除配置文件,删除配置文件同时会通知客户端 Not_Found
func (*Server) DeleteConfigFileFromClient ¶ added in v1.18.0
func (s *Server) DeleteConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
DeleteConfigFileFromClient 调用config_file的方法更新配置文件
func (*Server) DeleteConfigFileGroup ¶
func (s *Server) DeleteConfigFileGroup(ctx context.Context, namespace, name string) *apiconfig.ConfigResponse
DeleteConfigFileGroup 删除配置文件组
func (*Server) DeleteConfigFileReleases ¶ added in v1.17.3
func (s *Server) DeleteConfigFileReleases(ctx context.Context, reqs []*apiconfig.ConfigFileRelease) *apiconfig.ConfigBatchWriteResponse
DeleteConfigFileRelease 删除某个配置文件的发布 release
func (*Server) ExportConfigFile ¶ added in v1.15.0
func (s *Server) ExportConfigFile(ctx context.Context, configFileExport *apiconfig.ConfigFileExportRequest) *apiconfig.ConfigExportResponse
ExportConfigFile 导出配置文件
func (*Server) FileCache ¶ added in v1.18.0
func (s *Server) FileCache() cachetypes.ConfigFileCache
Cache 获取配置中心缓存模块
func (*Server) GetAllConfigEncryptAlgorithms ¶ added in v1.17.2
func (s *Server) GetAllConfigEncryptAlgorithms(ctx context.Context) *apiconfig.ConfigEncryptAlgorithmResponse
GetAllConfigEncryptAlgorithms 获取配置加密算法
func (*Server) GetAllConfigFileTemplates ¶
func (s *Server) GetAllConfigFileTemplates(ctx context.Context) *apiconfig.ConfigBatchQueryResponse
GetAllConfigFileTemplates get all config file templates
func (*Server) GetConfigFileNamesWithCache ¶ added in v1.17.3
func (s *Server) GetConfigFileNamesWithCache(ctx context.Context, req *apiconfig.ConfigFileGroupRequest) *apiconfig.ConfigClientListResponse
GetConfigFileNamesWithCache
func (*Server) GetConfigFileRelease ¶
func (s *Server) GetConfigFileRelease(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse
GetConfigFileRelease 获取配置文件发布内容
func (*Server) GetConfigFileReleaseHistories ¶ added in v1.17.3
func (s *Server) GetConfigFileReleaseHistories(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse
GetConfigFileReleaseHistories 获取配置文件发布历史记录
func (*Server) GetConfigFileReleaseVersions ¶ added in v1.17.3
func (*Server) GetConfigFileReleases ¶ added in v1.17.3
func (*Server) GetConfigFileRichInfo ¶
func (s *Server) GetConfigFileRichInfo(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
GetConfigFileRichInfo 获取单个配置文件基础信息,包含发布状态等信息
func (*Server) GetConfigFileTemplate ¶
GetConfigFileTemplate get config file template by name
func (*Server) GetConfigFileWithCache ¶ added in v1.18.0
func (s *Server) GetConfigFileWithCache(ctx context.Context, req *apiconfig.ClientConfigFileInfo) *apiconfig.ConfigClientResponse
GetConfigFileWithCache 从缓存中获取配置文件,如果客户端的版本号大于服务端,则服务端重新加载缓存
func (*Server) GetConfigGroupsWithCache ¶ added in v1.18.0
func (s *Server) GetConfigGroupsWithCache(ctx context.Context, req *apiconfig.ClientConfigFileInfo) *apiconfig.ConfigDiscoverResponse
func (*Server) GroupCache ¶ added in v1.18.0
func (s *Server) GroupCache() cachetypes.ConfigGroupCache
Cache 获取配置中心缓存模块
func (*Server) ImportConfigFile ¶ added in v1.15.0
func (s *Server) ImportConfigFile(ctx context.Context, configFiles []*apiconfig.ConfigFile, conflictHandling string) *apiconfig.ConfigImportResponse
ImportConfigFile 导入配置文件
func (*Server) LongPullWatchFile ¶ added in v1.18.0
func (s *Server) LongPullWatchFile(ctx context.Context, req *apiconfig.ClientWatchConfigFileRequest) (WatchCallback, error)
LongPullWatchFile .
func (*Server) PublishConfigFile ¶
func (s *Server) PublishConfigFile(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse
PublishConfigFile 发布配置文件
func (*Server) PublishConfigFileFromClient ¶ added in v1.17.2
func (s *Server) PublishConfigFileFromClient(ctx context.Context, client *apiconfig.ConfigFileRelease) *apiconfig.ConfigClientResponse
PublishConfigFileFromClient 调用config_file_release接口发布配置文件
func (*Server) QueryConfigFileGroups ¶
func (s *Server) QueryConfigFileGroups(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse
QueryConfigFileGroups 查询配置文件组
func (*Server) RecordHistory ¶ added in v1.14.0
func (s *Server) RecordHistory(ctx context.Context, entry *model.RecordEntry)
RecordHistory server对外提供history插件的简单封装
func (*Server) RollbackConfigFileRelease ¶ added in v1.17.3
func (s *Server) RollbackConfigFileRelease(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse
RollbackConfigFileRelease 回滚配置
func (*Server) RollbackConfigFileReleases ¶ added in v1.17.3
func (s *Server) RollbackConfigFileReleases(ctx context.Context, reqs []*apiconfig.ConfigFileRelease) *apiconfig.ConfigBatchWriteResponse
func (*Server) SearchConfigFile ¶
func (s *Server) SearchConfigFile(ctx context.Context, filter map[string]string) *apiconfig.ConfigBatchQueryResponse
SearchConfigFile 查询配置文件
func (*Server) SetResourceHooks ¶
func (s *Server) SetResourceHooks(hooks ...ResourceHook)
SetResourceHooks 设置资源钩子
func (*Server) StopGrayConfigFileRelease ¶ added in v1.18.0
func (s *Server) StopGrayConfigFileRelease(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigResponse
func (*Server) StopGrayConfigFileReleases ¶ added in v1.18.0
func (s *Server) StopGrayConfigFileReleases(ctx context.Context, reqs []*apiconfig.ConfigFileRelease) *apiconfig.ConfigBatchWriteResponse
func (*Server) TestCheckClientConfigFile ¶ added in v1.17.3
func (s *Server) TestCheckClientConfigFile(ctx context.Context, files []*apiconfig.ClientConfigFileInfo, compartor CompareFunction) (*apiconfig.ConfigClientResponse, bool)
func (*Server) TestDecryptConfigFile ¶ added in v1.17.3
func (s *Server) TestDecryptConfigFile(ctx context.Context, configFile *model.ConfigFile) (err error)
TestDecryptConfigFile 解密配置文件
func (*Server) TestEncryptConfigFile ¶ added in v1.17.3
func (s *Server) TestEncryptConfigFile(ctx context.Context, configFile *model.ConfigFile, algorithm string, dataKey string) error
TestEncryptConfigFile 解密配置文件
func (*Server) TestMockCryptoManager ¶ added in v1.17.3
func (s *Server) TestMockCryptoManager(mgr plugin.CryptoManager)
TestMockCryptoManager 获取加密管理
func (*Server) TestMockStore ¶ added in v1.17.3
TestMockStore
func (*Server) UpdateConfigFile ¶
func (s *Server) UpdateConfigFile(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigResponse
UpdateConfigFile 更新配置文件
func (*Server) UpdateConfigFileFromClient ¶ added in v1.17.2
func (s *Server) UpdateConfigFileFromClient(ctx context.Context, client *apiconfig.ConfigFile) *apiconfig.ConfigClientResponse
UpdateConfigFileFromClient 调用config_file接口更新配置文件
func (*Server) UpdateConfigFileGroup ¶
func (s *Server) UpdateConfigFileGroup(ctx context.Context, req *apiconfig.ConfigFileGroup) *apiconfig.ConfigResponse
UpdateConfigFileGroup 更新配置文件组
func (*Server) UpsertAndReleaseConfigFile ¶ added in v1.17.3
func (s *Server) UpsertAndReleaseConfigFile(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse
func (*Server) UpsertAndReleaseConfigFileFromClient ¶ added in v1.18.0
func (s *Server) UpsertAndReleaseConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFilePublishInfo) *apiconfig.ConfigResponse
UpsertAndReleaseConfigFile 创建/更新配置文件并发布
type ServerProxyFactory ¶ added in v1.18.0
type ServerProxyFactory func(cacheMgr cachetypes.CacheManager, pre ConfigCenterServer) (ConfigCenterServer, error)
type WatchContext ¶ added in v1.18.0
type WatchContext interface { // ClientID . ClientID() string // ClientLabels . ClientLabels() map[string]string // AppendInterest . AppendInterest(item *apiconfig.ClientConfigFileInfo) // RemoveInterest . RemoveInterest(item *apiconfig.ClientConfigFileInfo) // ShouldNotify . ShouldNotify(event *model.SimpleConfigFileRelease) bool // Reply . Reply(rsp *apiconfig.ConfigClientResponse) // Close . Close() error // ShouldExpire . ShouldExpire(now time.Time) bool // ListWatchFiles ListWatchFiles() []*apiconfig.ClientConfigFileInfo // IsOnce IsOnce() bool }
type WatchContextFactory ¶ added in v1.18.0
type WatchContextFactory func(clientId string, matcher BetaReleaseMatcher) WatchContext
func BuildTimeoutWatchCtx ¶ added in v1.18.0
func BuildTimeoutWatchCtx(ctx context.Context, watchTimeOut time.Duration) WatchContextFactory