Documentation ¶
Index ¶
- Constants
- func CalMd5(content string) string
- func CheckContentLength(content string, max int) error
- func CheckFileName(name *wrappers.StringValue) error
- func CheckResourceName(name *wrappers.StringValue) error
- func CompressConfigFiles(files []*model.ConfigFile, fileID2Tags map[uint64][]*model.ConfigFileTag, ...) (*bytes.Buffer, error)
- func FromTagJson(tagStr string) []*apiconfig.ConfigFileTag
- func GenConfigFileResponse(namespace, group, fileName, content, md5str string, version uint64) *apiconfig.ConfigClientResponse
- func GenReleaseName(oldReleaseName, fileName string) string
- func Initialize(ctx context.Context, config Config, s store.Store, ...) error
- func NewConfigConnManager(ctx context.Context, watchCenter *watchCenter) *connManager
- func NewWatchCenter() (*watchCenter, error)
- func TestCompareByMD5(clientInfo *apiconfig.ClientConfigFileInfo, file *model.ConfigFileRelease) bool
- func TestCompareByVersion(clientInfo *apiconfig.ClientConfigFileInfo, file *model.ConfigFileRelease) bool
- func TestInitialize(ctx context.Context, config Config, s store.Store, ...) (ConfigCenterServer, ConfigCenterServer, error)
- func ToTagJsonStr(tags []*apiconfig.ConfigFileTag) string
- type ClientConn
- 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 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, release *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) Cache() cachetypes.ConfigFileCache
- func (s *Server) ConnManager() *connManager
- 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) 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) GetAllConfigEncryptAlgorithms(ctx context.Context) *apiconfig.ConfigEncryptAlgorithmResponse
- func (s *Server) GetAllConfigFileTemplates(ctx context.Context) *apiconfig.ConfigBatchQueryResponse
- func (s *Server) GetConfigFileForClient(ctx context.Context, client *apiconfig.ClientConfigFileInfo) *apiconfig.ConfigClientResponse
- 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) ImportConfigFile(ctx context.Context, configFiles []*apiconfig.ConfigFile, ...) *apiconfig.ConfigImportResponse
- 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) 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) WatchCenter() *watchCenter
- func (s *Server) WatchConfigFiles(ctx context.Context, req *apiconfig.ClientWatchConfigFileRequest) (WatchCallback, error)
- type WatchCallback
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 CheckResourceName ¶ added in v1.17.3
func CheckResourceName(name *wrappers.StringValue) error
CheckResourceName 检查资源名称
func CompressConfigFiles ¶ added in v1.17.3
func CompressConfigFiles(files []*model.ConfigFile, fileID2Tags map[uint64][]*model.ConfigFileTag, isExportGroup bool) (*bytes.Buffer, error)
func FromTagJson ¶ added in v1.17.3
func FromTagJson(tagStr string) []*apiconfig.ConfigFileTag
FromTagJson 从 Tags Json 字符串里反序列化出 Tags
func GenConfigFileResponse ¶ added in v1.17.3
func GenConfigFileResponse(namespace, group, fileName, content, md5str string, version uint64) *apiconfig.ConfigClientResponse
GenConfigFileResponse 为客户端生成响应对象
func GenReleaseName ¶ added in v1.17.3
GenReleaseName 生成发布名称,规则是 filename-${三位自增长序列}
func Initialize ¶
func Initialize(ctx context.Context, config Config, s store.Store, cacheMgn *cache.CacheManager, namespaceOperator namespace.NamespaceOperateServer, userMgn auth.UserServer, strategyMgn auth.StrategyServer) error
Initialize 初始化配置中心模块
func NewConfigConnManager ¶
NewConfigConnManager 初始化连接管理器,定时响应超时的请求
func TestCompareByMD5 ¶ added in v1.17.3
func TestCompareByMD5(clientInfo *apiconfig.ClientConfigFileInfo, file *model.ConfigFileRelease) bool
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, ConfigCenterServer, error)
Initialize 初始化配置中心模块
func ToTagJsonStr ¶ added in v1.17.3
func ToTagJsonStr(tags []*apiconfig.ConfigFileTag) string
ToTagJsonStr 把 Tags 转化成 Json 字符串
Types ¶
type ClientConn ¶ added in v1.17.3
type ClientConn struct {
// contains filtered or unexported fields
}
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 { // GetConfigFileForClient 获取配置文件 GetConfigFileForClient(ctx context.Context, req *apiconfig.ClientConfigFileInfo) *apiconfig.ConfigClientResponse // CreateConfigFileFromClient 调用config_file的方法创建配置文件 CreateConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigClientResponse // UpdateConfigFileFromClient 调用config_file的方法更新配置文件 UpdateConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFile) *apiconfig.ConfigClientResponse // PublishConfigFileFromClient 调用config_file_release的方法发布配置文件 PublishConfigFileFromClient(ctx context.Context, req *apiconfig.ConfigFileRelease) *apiconfig.ConfigClientResponse // WatchConfigFiles 客户端监听配置文件 WatchConfigFiles(ctx context.Context, req *apiconfig.ClientWatchConfigFileRequest) (WatchCallback, error) // GetConfigFileNamesWithCache 获取某个配置分组下的配置文件 GetConfigFileNamesWithCache(ctx context.Context, req *apiconfig.ConfigFileGroupRequest) *apiconfig.ConfigClientListResponse }
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 }
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 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, release *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) 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) 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) 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) GetConfigFileForClient ¶
func (s *Server) GetConfigFileForClient(ctx context.Context, client *apiconfig.ClientConfigFileInfo) *apiconfig.ConfigClientResponse
GetConfigFileForClient 从缓存中获取配置文件,如果客户端的版本号大于服务端,则服务端重新加载缓存
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) ImportConfigFile ¶ added in v1.15.0
func (s *Server) ImportConfigFile(ctx context.Context, configFiles []*apiconfig.ConfigFile, conflictHandling string) *apiconfig.ConfigImportResponse
ImportConfigFile 导入配置文件
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) 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) WatchConfigFiles ¶
func (s *Server) WatchConfigFiles(ctx context.Context, req *apiconfig.ClientWatchConfigFileRequest) (WatchCallback, error)
Source Files ¶
- api.go
- client.go
- client_authibility.go
- common.go
- config_chain.go
- config_file.go
- config_file_authibility.go
- config_file_group.go
- config_file_group_authibility.go
- config_file_release.go
- config_file_release_authibility.go
- config_file_release_history.go
- config_file_release_history_authibility.go
- config_file_template.go
- config_file_template_authibility.go
- connection_manager.go
- log.go
- resource_listener.go
- server.go
- server_authability.go
- test_export.go
- utils.go
- watcher.go