Documentation ¶
Index ¶
- Constants
- Variables
- func BatchOperation(label string, data []interface{}, handler BatchHandler) error
- func BatchQuery(label string, data []interface{}, handler BatchHandler) error
- func ConvertSecond(ctime time.Time) int64
- func CurrDiffTimeSecond(beforeTime time.Time) float64
- func GetCurrentSsTimestamp() int64
- func GetCurrentTimeFormat() string
- func GetLocation() *time.Location
- func NewSqlDBTx(delegateTx *BaseTx) store.Tx
- func PlaceholdersNI(size, indexSort int) (string, int)
- func Retry(label string, handle func() error)
- func RetryTransaction(label string, handle func() error) error
- func TimestampToInt64(timeStr string) int64
- func UnixSecondToTime(second int64) time.Time
- type BaseDB
- type BaseTx
- type BatchHandler
- type LeaderElectionStore
- type Order
- type Page
- type PostgresqlStore
- func (cfr PostgresqlStore) ActiveConfigFileReleaseTx(tx store.Tx, release *model.ConfigFileRelease) error
- func (u PostgresqlStore) AddGroup(group *model.UserGroupDetail) error
- func (ins PostgresqlStore) AddInstance(instance *model.Instance) error
- func (ns PostgresqlStore) AddNamespace(namespace *model.Namespace) error
- func (ss PostgresqlStore) AddService(s *model.Service) error
- func (s PostgresqlStore) AddServiceContractInterfaces(contract *model.EnrichServiceContract) error
- func (s PostgresqlStore) AddStrategy(strategy *model.StrategyDetail) error
- func (u PostgresqlStore) AddUser(user *model.User) error
- func (s PostgresqlStore) AppendServiceContractInterfaces(contract *model.EnrichServiceContract) error
- func (cs PostgresqlStore) BatchAddClients(clients []*model.Client) error
- func (ins PostgresqlStore) BatchAddInstances(instances []*model.Instance) error
- func (ins PostgresqlStore) BatchAppendInstanceMetadata(requests []*store.InstanceMetadataRequest) error
- func (m PostgresqlStore) BatchCleanDeletedClients(timeout time.Duration, batchSize uint32) (uint32, error)
- func (m PostgresqlStore) BatchCleanDeletedInstances(timeout time.Duration, batchSize uint32) (uint32, error)
- func (cs PostgresqlStore) BatchDeleteClients(ids []string) error
- func (ins PostgresqlStore) BatchDeleteInstances(ids []interface{}) error
- func (ins PostgresqlStore) BatchGetInstanceIsolate(ids map[string]bool) (map[string]bool, error)
- func (ins PostgresqlStore) BatchRemoveInstanceMetadata(requests []*store.InstanceMetadataRequest) error
- func (ins PostgresqlStore) BatchSetInstanceHealthStatus(ids []interface{}, isolate int, revision string) error
- func (ins PostgresqlStore) BatchSetInstanceIsolate(ids []interface{}, isolate int, revision string) error
- func (rh PostgresqlStore) CleanConfigFileReleaseHistory(endTime time.Time, limit uint64) error
- func (cfr PostgresqlStore) CleanConfigFileReleasesTx(tx store.Tx, namespace, group, fileName string) error
- func (cfr PostgresqlStore) CleanDeletedConfigFileRelease(endTime time.Time, limit uint64) error
- func (g PostgresqlStore) CleanGrayResource(tx store.Tx, data *model.GrayResource) error
- func (ins PostgresqlStore) CleanInstance(instanceID string) error
- func (cf PostgresqlStore) CountConfigFileEachGroup() (map[string]map[string]int64, error)
- func (cf PostgresqlStore) CountConfigFiles(namespace, group string) (uint64, error)
- func (fg PostgresqlStore) CountConfigGroups(namespace string) (uint64, error)
- func (cfr PostgresqlStore) CountConfigReleases(namespace, group string, onlyActive bool) (uint64, error)
- func (c PostgresqlStore) CreateCircuitBreakerRule(cbRule *model.CircuitBreakerRule) error
- func (cs PostgresqlStore) CreateClient(client *model.Client) error
- func (fg PostgresqlStore) CreateConfigFileGroup(fileGroup *model.ConfigFileGroup) (*model.ConfigFileGroup, error)
- func (rh PostgresqlStore) CreateConfigFileReleaseHistory(history *model.ConfigFileReleaseHistory) error
- func (cfr PostgresqlStore) CreateConfigFileReleaseTx(tx store.Tx, data *model.ConfigFileRelease) error
- func (cf PostgresqlStore) CreateConfigFileTemplate(template *model.ConfigFileTemplate) (*model.ConfigFileTemplate, error)
- func (cf PostgresqlStore) CreateConfigFileTx(tx store.Tx, file *model.ConfigFile) error
- func (f PostgresqlStore) CreateFaultDetectRule(fdRule *model.FaultDetectRule) error
- func (g PostgresqlStore) CreateGrayResourceTx(tx store.Tx, data *model.GrayResource) error
- func (rls PostgresqlStore) CreateRateLimit(limit *model.RateLimit) error
- func (rs PostgresqlStore) CreateRoutingConfig(conf *model.RoutingConfig) error
- func (r PostgresqlStore) CreateRoutingConfigV2(conf *model.RouterConfig) error
- func (r PostgresqlStore) CreateRoutingConfigV2Tx(tx store.Tx, conf *model.RouterConfig) error
- func (s PostgresqlStore) CreateServiceContract(contract *model.ServiceContract) error
- func (p *PostgresqlStore) CreateTransaction() (store.Transaction, error)
- func (c PostgresqlStore) DeleteCircuitBreakerRule(id string) error
- func (fg PostgresqlStore) DeleteConfigFileGroup(namespace, name string) error
- func (cfr PostgresqlStore) DeleteConfigFileReleaseTx(tx store.Tx, data *model.ConfigFileReleaseKey) error
- func (cf PostgresqlStore) DeleteConfigFileTx(tx store.Tx, namespace, group, name string) error
- func (f PostgresqlStore) DeleteFaultDetectRule(id string) error
- func (g PostgresqlStore) DeleteGrayResource(tx store.Tx, data *model.GrayResource) error
- func (u PostgresqlStore) DeleteGroup(group *model.UserGroupDetail) error
- func (ins PostgresqlStore) DeleteInstance(instanceID string) error
- func (rls PostgresqlStore) DeleteRateLimit(limit *model.RateLimit) error
- func (rs PostgresqlStore) DeleteRoutingConfig(serviceID string) error
- func (rs PostgresqlStore) DeleteRoutingConfigTx(tx store.Tx, serviceID string) error
- func (r PostgresqlStore) DeleteRoutingConfigV2(ruleID string) error
- func (ss PostgresqlStore) DeleteService(id, serviceName, namespaceName string) error
- func (ss PostgresqlStore) DeleteServiceAlias(name string, namespace string) error
- func (s PostgresqlStore) DeleteServiceContract(contract *model.ServiceContract) error
- func (s PostgresqlStore) DeleteServiceContractInterfaces(contract *model.EnrichServiceContract) error
- func (s PostgresqlStore) DeleteStrategy(id string) error
- func (u PostgresqlStore) DeleteUser(user *model.User) error
- func (p *PostgresqlStore) Destroy() error
- func (c PostgresqlStore) EnableCircuitBreakerRule(cbRule *model.CircuitBreakerRule) error
- func (rls PostgresqlStore) EnableRateLimit(limit *model.RateLimit) error
- func (r PostgresqlStore) EnableRouting(conf *model.RouterConfig) error
- func (l5 PostgresqlStore) GenNextL5Sid(layoutID uint32) (string, error)
- func (c PostgresqlStore) GetCircuitBreakerRules(filter map[string]string, offset uint32, limit uint32) (uint32, []*model.CircuitBreakerRule, error)
- func (c PostgresqlStore) GetCircuitBreakerRulesForCache(mtime time.Time, firstUpdate bool) ([]*model.CircuitBreakerRule, error)
- func (cs PostgresqlStore) GetClientStat(clientID string) ([]*model.ClientStatStore, error)
- func (cf PostgresqlStore) GetConfigFile(namespace, group, name string) (*model.ConfigFile, error)
- func (cfr PostgresqlStore) GetConfigFileActiveRelease(file *model.ConfigFileKey) (*model.ConfigFileRelease, error)
- func (cfr PostgresqlStore) GetConfigFileActiveReleaseTx(tx store.Tx, file *model.ConfigFileKey) (*model.ConfigFileRelease, error)
- func (cfr PostgresqlStore) GetConfigFileBetaReleaseTx(tx store.Tx, file *model.ConfigFileKey) (*model.ConfigFileRelease, error)
- func (fg PostgresqlStore) GetConfigFileGroup(namespace, name string) (*model.ConfigFileGroup, error)
- func (cfr PostgresqlStore) GetConfigFileRelease(req *model.ConfigFileReleaseKey) (*model.ConfigFileRelease, error)
- func (cfr PostgresqlStore) GetConfigFileReleaseTx(tx store.Tx, req *model.ConfigFileReleaseKey) (*model.ConfigFileRelease, error)
- func (cf PostgresqlStore) GetConfigFileTemplate(name string) (*model.ConfigFileTemplate, error)
- func (cf PostgresqlStore) GetConfigFileTx(tx store.Tx, namespace, group, name string) (*model.ConfigFile, error)
- func (s PostgresqlStore) GetDefaultStrategyDetailByPrincipal(principalId string, principalType model.PrincipalType) (*model.StrategyDetail, error)
- func (ins PostgresqlStore) GetExpandInstances(filter, metaFilter map[string]string, offset uint32, limit uint32) (uint32, []*model.Instance, error)
- func (rls PostgresqlStore) GetExtendRateLimits(filter map[string]string, offset uint32, limit uint32) (uint32, []*model.ExtendRateLimit, error)
- func (f PostgresqlStore) GetFaultDetectRules(filter map[string]string, offset uint32, limit uint32) (uint32, []*model.FaultDetectRule, error)
- func (f PostgresqlStore) GetFaultDetectRulesForCache(mtime time.Time, firstUpdate bool) ([]*model.FaultDetectRule, error)
- func (u PostgresqlStore) GetGroup(groupId string) (*model.UserGroupDetail, error)
- func (u PostgresqlStore) GetGroupByName(name, owner string) (*model.UserGroup, error)
- func (u PostgresqlStore) GetGroups(filters map[string]string, offset uint32, limit uint32) (uint32, []*model.UserGroup, error)
- func (u PostgresqlStore) GetGroupsForCache(mtime time.Time, firstUpdate bool) ([]*model.UserGroupDetail, error)
- func (ins PostgresqlStore) GetInstance(instanceID string) (*model.Instance, error)
- func (ins PostgresqlStore) GetInstanceMeta(instanceID string) (map[string]string, error)
- func (ins PostgresqlStore) GetInstancesBrief(ids map[string]bool) (map[string]*model.Instance, error)
- func (ins PostgresqlStore) GetInstancesCount() (uint32, error)
- func (ins PostgresqlStore) GetInstancesCountTx(tx store.Tx) (uint32, error)
- func (ins PostgresqlStore) GetInstancesMainByService(serviceID, host string) ([]*model.Instance, error)
- func (l5 PostgresqlStore) GetL5Extend(serviceID string) (map[string]interface{}, error)
- func (cs PostgresqlStore) GetMoreClients(mtime time.Time, firstUpdate bool) (map[string]*model.Client, error)
- func (fg PostgresqlStore) GetMoreConfigGroup(firstUpdate bool, mtime time.Time) ([]*model.ConfigFileGroup, error)
- func (g PostgresqlStore) GetMoreGrayResouces(firstUpdate bool, modifyTime time.Time) ([]*model.GrayResource, error)
- func (ins PostgresqlStore) GetMoreInstances(tx store.Tx, mtime time.Time, firstUpdate, needMeta bool, serviceID []string) (map[string]*model.Instance, error)
- func (l5 PostgresqlStore) GetMoreL5Extend(mtime time.Time) (map[string]map[string]interface{}, error)
- func (l5 PostgresqlStore) GetMoreL5IPConfigs(flow uint32) ([]*model.IPConfig, error)
- func (l5 PostgresqlStore) GetMoreL5Policies(flow uint32) ([]*model.Policy, error)
- func (l5 PostgresqlStore) GetMoreL5Routes(flow uint32) ([]*model.Route, error)
- func (l5 PostgresqlStore) GetMoreL5Sections(flow uint32) ([]*model.Section, error)
- func (ns PostgresqlStore) GetMoreNamespaces(mtime time.Time) ([]*model.Namespace, error)
- func (cfr PostgresqlStore) GetMoreReleaseFile(firstUpdate bool, modifyTime time.Time) ([]*model.ConfigFileRelease, error)
- func (s PostgresqlStore) GetMoreServiceContracts(firstUpdate bool, mtime time.Time) ([]*model.EnrichServiceContract, error)
- func (ss PostgresqlStore) GetMoreServices(mtime time.Time, firstUpdate, disableBusiness, needMeta bool) (map[string]*model.Service, error)
- func (ns PostgresqlStore) GetNamespace(name string) (*model.Namespace, error)
- func (ns PostgresqlStore) GetNamespaces(filter map[string][]string, offset, limit int) ([]*model.Namespace, uint32, error)
- func (rls PostgresqlStore) GetRateLimitWithID(id string) (*model.RateLimit, error)
- func (rls PostgresqlStore) GetRateLimitsForCache(mtime time.Time, firstUpdate bool) ([]*model.RateLimit, error)
- func (r PostgresqlStore) GetRoutingConfigV2WithID(ruleID string) (*model.RouterConfig, error)
- func (r PostgresqlStore) GetRoutingConfigV2WithIDTx(tx store.Tx, ruleID string) (*model.RouterConfig, error)
- func (rs PostgresqlStore) GetRoutingConfigWithID(id string) (*model.RoutingConfig, error)
- func (rs PostgresqlStore) GetRoutingConfigWithService(name string, namespace string) (*model.RoutingConfig, error)
- func (rs PostgresqlStore) GetRoutingConfigs(filter map[string]string, offset uint32, limit uint32) (uint32, []*model.ExtendRoutingConfig, error)
- func (rs PostgresqlStore) GetRoutingConfigsForCache(mtime time.Time, firstUpdate bool) ([]*model.RoutingConfig, error)
- func (r PostgresqlStore) GetRoutingConfigsV2ForCache(mtime time.Time, firstUpdate bool) ([]*model.RouterConfig, error)
- func (ss PostgresqlStore) GetService(name string, namespace string) (*model.Service, error)
- func (ss PostgresqlStore) GetServiceAliases(filter map[string]string, offset uint32, limit uint32) (uint32, []*model.ServiceAlias, error)
- func (ss PostgresqlStore) GetServiceByID(id string) (*model.Service, error)
- func (s PostgresqlStore) GetServiceContract(id string) (data *model.EnrichServiceContract, err error)
- func (ss PostgresqlStore) GetServices(serviceFilters, serviceMetas map[string]string, ...) (uint32, []*model.Service, error)
- func (ss PostgresqlStore) GetServicesBatch(services []*model.Service) ([]*model.Service, error)
- func (ss PostgresqlStore) GetServicesCount() (uint32, error)
- func (ss PostgresqlStore) GetSourceServiceToken(name string, namespace string) (*model.Service, error)
- func (s PostgresqlStore) GetStrategies(filters map[string]string, offset uint32, limit uint32) (uint32, []*model.StrategyDetail, error)
- func (s PostgresqlStore) GetStrategyDetail(id string) (*model.StrategyDetail, error)
- func (s PostgresqlStore) GetStrategyDetailsForCache(mtime time.Time, firstUpdate bool) ([]*model.StrategyDetail, error)
- func (s PostgresqlStore) GetStrategyResources(principalId string, principalRole model.PrincipalType) ([]model.StrategyResource, error)
- func (u PostgresqlStore) GetSubCount(user *model.User) (uint32, error)
- func (ss PostgresqlStore) GetSystemServices() ([]*model.Service, error)
- func (m PostgresqlStore) GetUnHealthyInstances(timeout time.Duration, limit uint32) ([]string, error)
- func (t PostgresqlStore) GetUnixSecond(maxWait time.Duration) (int64, error)
- func (u PostgresqlStore) GetUser(id string) (*model.User, error)
- func (u PostgresqlStore) GetUserByIds(ids []string) ([]*model.User, error)
- func (u PostgresqlStore) GetUserByName(name, ownerId string) (*model.User, error)
- func (u PostgresqlStore) GetUsers(filters map[string]string, offset uint32, limit uint32) (uint32, []*model.User, error)
- func (u PostgresqlStore) GetUsersForCache(mtime time.Time, firstUpdate bool) ([]*model.User, error)
- func (c PostgresqlStore) HasCircuitBreakerRule(id string) (bool, error)
- func (c PostgresqlStore) HasCircuitBreakerRuleByName(name string, namespace string) (bool, error)
- func (c PostgresqlStore) HasCircuitBreakerRuleByNameExcludeId(name string, namespace string, id string) (bool, error)
- func (f PostgresqlStore) HasFaultDetectRule(id string) (bool, error)
- func (f PostgresqlStore) HasFaultDetectRuleByName(name string, namespace string) (bool, error)
- func (f PostgresqlStore) HasFaultDetectRuleByNameExcludeId(name string, namespace string, id string) (bool, error)
- func (cfr PostgresqlStore) InactiveConfigFileReleaseTx(tx store.Tx, release *model.ConfigFileRelease) error
- func (p *PostgresqlStore) Initialize(conf *store.Config) error
- func (m PostgresqlStore) IsLeader(key string) bool
- func (m PostgresqlStore) ListLeaderElections() ([]*model.LeaderElection, error)
- func (cf PostgresqlStore) LockConfigFile(tx store.Tx, file *model.ConfigFileKey) (*model.ConfigFile, error)
- func (s PostgresqlStore) LooseAddStrategyResources(resources []model.StrategyResource) error
- func (p *PostgresqlStore) Name() string
- func (cf PostgresqlStore) QueryAllConfigFileTemplates() ([]*model.ConfigFileTemplate, error)
- func (rh PostgresqlStore) QueryConfigFileReleaseHistories(filter map[string]string, offset, limit uint32) (uint32, []*model.ConfigFileReleaseHistory, error)
- func (cf PostgresqlStore) QueryConfigFiles(filter map[string]string, offset, limit uint32) (uint32, []*model.ConfigFile, error)
- func (m PostgresqlStore) ReleaseLeaderElection(key string) error
- func (s PostgresqlStore) RemoveStrategyResources(resources []model.StrategyResource) error
- func (ins PostgresqlStore) SetInstanceHealthStatus(instanceID string, flag int, revision string) error
- func (l5 PostgresqlStore) SetL5Extend(serviceID string, meta map[string]interface{}) (map[string]interface{}, error)
- func (m PostgresqlStore) StartLeaderElection(key string) error
- func (p *PostgresqlStore) StartReadTx() (store.Tx, error)
- func (p *PostgresqlStore) StartTx() (store.Tx, error)
- func (m PostgresqlStore) StopLeaderElections()
- func (c PostgresqlStore) UpdateCircuitBreakerRule(cbRule *model.CircuitBreakerRule) error
- func (cs PostgresqlStore) UpdateClient(client *model.Client) error
- func (fg PostgresqlStore) UpdateConfigFileGroup(fileGroup *model.ConfigFileGroup) error
- func (cf PostgresqlStore) UpdateConfigFileTx(tx store.Tx, file *model.ConfigFile) error
- func (f PostgresqlStore) UpdateFaultDetectRule(fdRule *model.FaultDetectRule) error
- func (u PostgresqlStore) UpdateGroup(group *model.ModifyUserGroup) error
- func (ins PostgresqlStore) UpdateInstance(instance *model.Instance) error
- func (ns PostgresqlStore) UpdateNamespace(namespace *model.Namespace) error
- func (ns PostgresqlStore) UpdateNamespaceToken(name string, token string) error
- func (rls PostgresqlStore) UpdateRateLimit(limit *model.RateLimit) error
- func (rs PostgresqlStore) UpdateRoutingConfig(conf *model.RoutingConfig) error
- func (r PostgresqlStore) UpdateRoutingConfigV2(conf *model.RouterConfig) error
- func (r PostgresqlStore) UpdateRoutingConfigV2Tx(tx store.Tx, conf *model.RouterConfig) error
- func (ss PostgresqlStore) UpdateService(service *model.Service, needUpdateOwner bool) error
- func (ss PostgresqlStore) UpdateServiceAlias(alias *model.Service, needUpdateOwner bool) error
- func (s PostgresqlStore) UpdateServiceContract(contract *model.ServiceContract) error
- func (ss PostgresqlStore) UpdateServiceToken(id string, token string, revision string) error
- func (s PostgresqlStore) UpdateStrategy(strategy *model.ModifyStrategyDetail) error
- func (u PostgresqlStore) UpdateUser(user *model.User) error
- type QueryHandler
- type Tx
Constants ¶
const ( TickTime = 2 LeaseTime = 10 )
const ( // SystemNamespace system namespace SystemNamespace = "Polaris" // STORENAME database storage name STORENAME = "postgresqlStore" // DefaultConnMaxLifetime default maximum connection lifetime DefaultConnMaxLifetime = 60 * 30 // 默认是30分钟 )
const ( // IDAttribute is the name of the attribute that stores the ID of the object. IDAttribute string = "id" // NameAttribute will be used as the name of the attribute that stores the name of the object. NameAttribute string = "name" // FlagAttribute will be used as the name of the attribute that stores the flag of the object. FlagAttribute string = "flag" // GroupIDAttribute will be used as the name of the attribute that stores the group ID of the object. GroupIDAttribute string = "group_id" )
const ( OwnerAttribute string = "owner" And = " and" )
Variables ¶
var ( RuleFilters map[string]string = map[string]string{ "res_id": "ar.res_id", "res_type": "ar.res_type", "default": "ag.default", "owner": "ag.owner", "name": "ag.name", "principal_id": "ap.principal_id", "principal_type": "ap.principal_role", } RuleNeedLikeFilters map[string]struct{} = map[string]struct{}{ "name": {}, } )
var (
ErrTxIsNil = errors.New("tx is nil")
)
Functions ¶
func BatchOperation ¶
func BatchOperation(label string, data []interface{}, handler BatchHandler) error
BatchOperation 批量操作 @note 每次最多操作100个
func BatchQuery ¶
func BatchQuery(label string, data []interface{}, handler BatchHandler) error
BatchQuery 批量查询数据的对外接口 每次最多查询200个
func CurrDiffTimeSecond ¶
func GetCurrentSsTimestamp ¶
func GetCurrentSsTimestamp() int64
func GetCurrentTimeFormat ¶
func GetCurrentTimeFormat() string
GetCurrentTimeFormat 获取格式化时间 @param millTime:时间毫秒 @return 2006-01-02 15:04:05
func GetLocation ¶
func NewSqlDBTx ¶
func PlaceholdersNI ¶
PlaceholdersNI PlaceholdersN 构造多个占位符
func RetryTransaction ¶
RetryTransaction 事务重试
Types ¶
type BaseDB ¶
BaseDB 对sql.DB的封装
func NewBaseDB ¶
func NewBaseDB(cfg *dbConfig, parsePwd plugin.ParsePassword) (*BaseDB, error)
NewBaseDB 新建一个BaseDB
type LeaderElectionStore ¶
type LeaderElectionStore interface { CreateLeaderElection(key string) error // GetVersion get current version GetVersion(key string) (int64, error) // CompareAndSwapVersion cas version CompareAndSwapVersion(key string, curVersion int64, newVersion int64, leader string) (bool, error) // CheckMtimeExpired check mtime expired CheckMtimeExpired(key string, leaseTime int32) (string, bool, error) // ListLeaderElections list all leaderelection ListLeaderElections() ([]*model.LeaderElection, error) }
type PostgresqlStore ¶
type PostgresqlStore struct {
// contains filtered or unexported fields
}
PostgresqlStore 实现了Store接口
func (PostgresqlStore) ActiveConfigFileReleaseTx ¶
func (cfr PostgresqlStore) ActiveConfigFileReleaseTx(tx store.Tx, release *model.ConfigFileRelease) error
ActiveConfigFileReleaseTx activates the specified config file release within a transaction.
func (PostgresqlStore) AddGroup ¶
func (u PostgresqlStore) AddGroup(group *model.UserGroupDetail) error
AddGroup 创建一个用户组
func (PostgresqlStore) AddInstance ¶
AddInstance 添加实例
func (PostgresqlStore) AddNamespace ¶
AddNamespace 添加命名空间
func (PostgresqlStore) AddService ¶
AddService 增加服务
func (PostgresqlStore) AddServiceContractInterfaces ¶
func (s PostgresqlStore) AddServiceContractInterfaces(contract *model.EnrichServiceContract) error
AddServiceContractInterfaces 创建服务契约API接口
func (PostgresqlStore) AddStrategy ¶
func (s PostgresqlStore) AddStrategy(strategy *model.StrategyDetail) error
func (PostgresqlStore) AppendServiceContractInterfaces ¶
func (s PostgresqlStore) AppendServiceContractInterfaces(contract *model.EnrichServiceContract) error
AppendServiceContractInterfaces 追加服务契约API接口
func (PostgresqlStore) BatchAddClients ¶
BatchAddClients 增加多个实例
func (PostgresqlStore) BatchAddInstances ¶
BatchAddInstances 批量增加实例
func (PostgresqlStore) BatchAppendInstanceMetadata ¶
func (ins PostgresqlStore) BatchAppendInstanceMetadata(requests []*store.InstanceMetadataRequest) error
BatchAppendInstanceMetadata 追加实例 metadata
func (PostgresqlStore) BatchCleanDeletedClients ¶
func (m PostgresqlStore) BatchCleanDeletedClients(timeout time.Duration, batchSize uint32) (uint32, error)
BatchCleanDeletedClients 批量删除客户端
func (PostgresqlStore) BatchCleanDeletedInstances ¶
func (m PostgresqlStore) BatchCleanDeletedInstances(timeout time.Duration, batchSize uint32) (uint32, error)
BatchCleanDeletedInstances 批量删除实例
func (PostgresqlStore) BatchDeleteClients ¶
BatchDeleteClients 批量删除实例,flag=1
func (PostgresqlStore) BatchDeleteInstances ¶
func (ins PostgresqlStore) BatchDeleteInstances(ids []interface{}) error
BatchDeleteInstances
func (PostgresqlStore) BatchGetInstanceIsolate ¶
BatchGetInstanceIsolate 检查实例是否存在
func (PostgresqlStore) BatchRemoveInstanceMetadata ¶
func (ins PostgresqlStore) BatchRemoveInstanceMetadata(requests []*store.InstanceMetadataRequest) error
BatchRemoveInstanceMetadata 删除实例指定的 metadata
func (PostgresqlStore) BatchSetInstanceHealthStatus ¶
func (ins PostgresqlStore) BatchSetInstanceHealthStatus(ids []interface{}, isolate int, revision string) error
BatchSetInstanceHealthStatus 批量设置健康状态
func (PostgresqlStore) BatchSetInstanceIsolate ¶
func (ins PostgresqlStore) BatchSetInstanceIsolate(ids []interface{}, isolate int, revision string) error
BatchSetInstanceIsolate 批量设置实例隔离状态
func (PostgresqlStore) CleanConfigFileReleaseHistory ¶
CleanConfigFileReleaseHistory 清理配置发布历史
func (PostgresqlStore) CleanConfigFileReleasesTx ¶
func (PostgresqlStore) CleanDeletedConfigFileRelease ¶
CleanDeletedConfigFileRelease 清理配置发布历史
func (PostgresqlStore) CleanGrayResource ¶
func (g PostgresqlStore) CleanGrayResource(tx store.Tx, data *model.GrayResource) error
func (PostgresqlStore) CleanInstance ¶
CleanInstance 清理数据
func (PostgresqlStore) CountConfigFileEachGroup ¶
func (PostgresqlStore) CountConfigFiles ¶
func (PostgresqlStore) CountConfigGroups ¶
func (PostgresqlStore) CountConfigReleases ¶
func (cfr PostgresqlStore) CountConfigReleases(namespace, group string, onlyActive bool) (uint64, error)
CountConfigReleases 获取一个配置文件组下的文件数量
func (PostgresqlStore) CreateCircuitBreakerRule ¶
func (c PostgresqlStore) CreateCircuitBreakerRule(cbRule *model.CircuitBreakerRule) error
func (PostgresqlStore) CreateClient ¶
CreateClient insert the client info
func (PostgresqlStore) CreateConfigFileGroup ¶
func (fg PostgresqlStore) CreateConfigFileGroup( fileGroup *model.ConfigFileGroup) (*model.ConfigFileGroup, error)
CreateConfigFileGroup 创建配置文件组
func (PostgresqlStore) CreateConfigFileReleaseHistory ¶
func (rh PostgresqlStore) CreateConfigFileReleaseHistory(history *model.ConfigFileReleaseHistory) error
CreateConfigFileReleaseHistory 创建配置文件发布历史记录
func (PostgresqlStore) CreateConfigFileReleaseTx ¶
func (cfr PostgresqlStore) CreateConfigFileReleaseTx(tx store.Tx, data *model.ConfigFileRelease) error
CreateConfigFileReleaseTx 新建配置文件发布
func (PostgresqlStore) CreateConfigFileTemplate ¶
func (cf PostgresqlStore) CreateConfigFileTemplate( template *model.ConfigFileTemplate) (*model.ConfigFileTemplate, error)
CreateConfigFileTemplate create config file template
func (PostgresqlStore) CreateConfigFileTx ¶
func (cf PostgresqlStore) CreateConfigFileTx(tx store.Tx, file *model.ConfigFile) error
CreateConfigFileTx 创建配置文件
func (PostgresqlStore) CreateFaultDetectRule ¶
func (f PostgresqlStore) CreateFaultDetectRule(fdRule *model.FaultDetectRule) error
CreateFaultDetectRule create fault detect rule
func (PostgresqlStore) CreateGrayResourceTx ¶
func (g PostgresqlStore) CreateGrayResourceTx(tx store.Tx, data *model.GrayResource) error
CreateGrayResourceTx 创建灰度资源
func (PostgresqlStore) CreateRateLimit ¶
CreateRateLimit 新建限流规则
func (PostgresqlStore) CreateRoutingConfig ¶
func (rs PostgresqlStore) CreateRoutingConfig(conf *model.RoutingConfig) error
CreateRoutingConfig 新建RoutingConfig
func (PostgresqlStore) CreateRoutingConfigV2 ¶
func (r PostgresqlStore) CreateRoutingConfigV2(conf *model.RouterConfig) error
CreateRoutingConfigV2 Add a new routing configuration
func (PostgresqlStore) CreateRoutingConfigV2Tx ¶
func (r PostgresqlStore) CreateRoutingConfigV2Tx(tx store.Tx, conf *model.RouterConfig) error
func (PostgresqlStore) CreateServiceContract ¶
func (s PostgresqlStore) CreateServiceContract(contract *model.ServiceContract) error
CreateServiceContract 创建服务契约
func (*PostgresqlStore) CreateTransaction ¶
func (p *PostgresqlStore) CreateTransaction() (store.Transaction, error)
CreateTransaction 创建一个事务
func (PostgresqlStore) DeleteCircuitBreakerRule ¶
DeleteCircuitBreakerRule 删除熔断规则
func (PostgresqlStore) DeleteConfigFileGroup ¶
DeleteConfigFileGroup 删除配置文件组
func (PostgresqlStore) DeleteConfigFileReleaseTx ¶
func (cfr PostgresqlStore) DeleteConfigFileReleaseTx(tx store.Tx, data *model.ConfigFileReleaseKey) error
func (PostgresqlStore) DeleteConfigFileTx ¶
func (PostgresqlStore) DeleteFaultDetectRule ¶
DeleteFaultDetectRule delete fault detect rule
func (PostgresqlStore) DeleteGrayResource ¶
func (g PostgresqlStore) DeleteGrayResource(tx store.Tx, data *model.GrayResource) error
DeleteGrayResource 删除灰度资源
func (PostgresqlStore) DeleteGroup ¶
func (u PostgresqlStore) DeleteGroup(group *model.UserGroupDetail) error
DeleteGroup 删除用户组
func (PostgresqlStore) DeleteInstance ¶
DeleteInstance 删除一个实例,删除实例实际上是把flag置为1
func (PostgresqlStore) DeleteRateLimit ¶
DeleteRateLimit 删除限流规则
func (PostgresqlStore) DeleteRoutingConfig ¶
DeleteRoutingConfig 删除
func (PostgresqlStore) DeleteRoutingConfigTx ¶
DeleteRoutingConfigTx 删除
func (PostgresqlStore) DeleteRoutingConfigV2 ¶
DeleteRoutingConfigV2 Delete a routing configuration
func (PostgresqlStore) DeleteService ¶
DeleteService 删除服务
func (PostgresqlStore) DeleteServiceAlias ¶
DeleteServiceAlias 删除服务别名
func (PostgresqlStore) DeleteServiceContract ¶
func (s PostgresqlStore) DeleteServiceContract(contract *model.ServiceContract) error
DeleteServiceContract 删除服务契约 删除该版本的全部数据
func (PostgresqlStore) DeleteServiceContractInterfaces ¶
func (s PostgresqlStore) DeleteServiceContractInterfaces(contract *model.EnrichServiceContract) error
DeleteServiceContractInterfaces 删除服务契约API接口
func (PostgresqlStore) DeleteStrategy ¶
func (PostgresqlStore) DeleteUser ¶
DeleteUser delete user by user id
func (PostgresqlStore) EnableCircuitBreakerRule ¶
func (c PostgresqlStore) EnableCircuitBreakerRule(cbRule *model.CircuitBreakerRule) error
EnableCircuitBreakerRule enable circuitbreaker rule
func (PostgresqlStore) EnableRateLimit ¶
EnableRateLimit 启用限流规则
func (PostgresqlStore) EnableRouting ¶
func (r PostgresqlStore) EnableRouting(conf *model.RouterConfig) error
EnableRouting Enable current limit rules
func (PostgresqlStore) GenNextL5Sid ¶
GenNextL5Sid 获取下一个sid
func (PostgresqlStore) GetCircuitBreakerRules ¶
func (PostgresqlStore) GetCircuitBreakerRulesForCache ¶
func (c PostgresqlStore) GetCircuitBreakerRulesForCache( mtime time.Time, firstUpdate bool) ([]*model.CircuitBreakerRule, error)
GetCircuitBreakerRulesForCache list circuitbreaker rules by query
func (PostgresqlStore) GetClientStat ¶
func (cs PostgresqlStore) GetClientStat(clientID string) ([]*model.ClientStatStore, error)
func (PostgresqlStore) GetConfigFile ¶
func (cf PostgresqlStore) GetConfigFile(namespace, group, name string) (*model.ConfigFile, error)
GetConfigFile 获取配置文件
func (PostgresqlStore) GetConfigFileActiveRelease ¶
func (cfr PostgresqlStore) GetConfigFileActiveRelease(file *model.ConfigFileKey) (*model.ConfigFileRelease, error)
func (PostgresqlStore) GetConfigFileActiveReleaseTx ¶
func (cfr PostgresqlStore) GetConfigFileActiveReleaseTx(tx store.Tx, file *model.ConfigFileKey) (*model.ConfigFileRelease, error)
GetConfigFileActiveReleaseTx retrieves the active release of a configuration file within a transaction.
func (PostgresqlStore) GetConfigFileBetaReleaseTx ¶
func (cfr PostgresqlStore) GetConfigFileBetaReleaseTx(tx store.Tx, file *model.ConfigFileKey) (*model.ConfigFileRelease, error)
GetConfigFileBetaReleaseTx retrieves the beta release of a configuration file within a transaction.
func (PostgresqlStore) GetConfigFileGroup ¶
func (fg PostgresqlStore) GetConfigFileGroup(namespace, name string) (*model.ConfigFileGroup, error)
GetConfigFileGroup 获取配置文件组
func (PostgresqlStore) GetConfigFileRelease ¶
func (cfr PostgresqlStore) GetConfigFileRelease(req *model.ConfigFileReleaseKey) (*model.ConfigFileRelease, error)
GetConfigFileRelease 获取配置文件发布,只返回 flag=0 的记录
func (PostgresqlStore) GetConfigFileReleaseTx ¶
func (cfr PostgresqlStore) GetConfigFileReleaseTx(tx store.Tx, req *model.ConfigFileReleaseKey) (*model.ConfigFileRelease, error)
GetConfigFileReleaseTx 在已开启的事务中获取配置文件发布内容,只获取 flag=0 的记录
func (PostgresqlStore) GetConfigFileTemplate ¶
func (cf PostgresqlStore) GetConfigFileTemplate(name string) (*model.ConfigFileTemplate, error)
GetConfigFileTemplate get config file template by name
func (PostgresqlStore) GetConfigFileTx ¶
func (PostgresqlStore) GetDefaultStrategyDetailByPrincipal ¶
func (s PostgresqlStore) GetDefaultStrategyDetailByPrincipal(principalId string, principalType model.PrincipalType) (*model.StrategyDetail, error)
GetDefaultStrategyDetailByPrincipal 获取默认策略
func (PostgresqlStore) GetExpandInstances ¶
func (ins PostgresqlStore) GetExpandInstances(filter, metaFilter map[string]string, offset uint32, limit uint32) (uint32, []*model.Instance, error)
GetExpandInstances 根据过滤条件查看对应服务实例及数目
func (PostgresqlStore) GetExtendRateLimits ¶
func (rls PostgresqlStore) GetExtendRateLimits( filter map[string]string, offset uint32, limit uint32) (uint32, []*model.ExtendRateLimit, error)
GetExtendRateLimits 根据过滤条件获取限流规则及数目
func (PostgresqlStore) GetFaultDetectRules ¶
func (f PostgresqlStore) GetFaultDetectRules( filter map[string]string, offset uint32, limit uint32) (uint32, []*model.FaultDetectRule, error)
GetFaultDetectRules get all fault detect rules by query and limit
func (PostgresqlStore) GetFaultDetectRulesForCache ¶
func (f PostgresqlStore) GetFaultDetectRulesForCache( mtime time.Time, firstUpdate bool) ([]*model.FaultDetectRule, error)
GetFaultDetectRulesForCache get increment circuitbreaker rules
func (PostgresqlStore) GetGroup ¶
func (u PostgresqlStore) GetGroup(groupId string) (*model.UserGroupDetail, error)
GetGroup 根据用户组ID获取用户组
func (PostgresqlStore) GetGroupByName ¶
GetGroupByName 根据 owner、name 获取用户组
func (PostgresqlStore) GetGroups ¶
func (u PostgresqlStore) GetGroups(filters map[string]string, offset uint32, limit uint32) (uint32, []*model.UserGroup, error)
GetGroups 根据不同的请求情况进行不同的用户组列表查询
func (PostgresqlStore) GetGroupsForCache ¶
func (u PostgresqlStore) GetGroupsForCache(mtime time.Time, firstUpdate bool) ([]*model.UserGroupDetail, error)
GetGroupsForCache .
func (PostgresqlStore) GetInstance ¶
GetInstance 获取单个实例详情,只返回有效的数据
func (PostgresqlStore) GetInstanceMeta ¶
GetInstanceMeta 根据实例ID获取实例的metadata
func (PostgresqlStore) GetInstancesBrief ¶
func (ins PostgresqlStore) GetInstancesBrief(ids map[string]bool) (map[string]*model.Instance, error)
GetInstancesBrief 批量获取实例的serviceID
func (PostgresqlStore) GetInstancesCount ¶
GetInstancesCount 获取有效的实例总数
func (PostgresqlStore) GetInstancesCountTx ¶
GetInstancesCountTx .
func (PostgresqlStore) GetInstancesMainByService ¶
func (ins PostgresqlStore) GetInstancesMainByService(serviceID, host string) ([]*model.Instance, error)
GetInstancesMainByService 根据服务和host获取实例 @note 不包括metadata
func (PostgresqlStore) GetL5Extend ¶
GetL5Extend 获取L5扩展数据
func (PostgresqlStore) GetMoreClients ¶
func (cs PostgresqlStore) GetMoreClients(mtime time.Time, firstUpdate bool) (map[string]*model.Client, error)
GetMoreClients 根据mtime获取增量clients,返回所有store的变更信息
func (PostgresqlStore) GetMoreConfigGroup ¶
func (PostgresqlStore) GetMoreGrayResouces ¶
func (g PostgresqlStore) GetMoreGrayResouces(firstUpdate bool, modifyTime time.Time) ([]*model.GrayResource, error)
GetMoreGrayResouces 获取最近更新的灰度资源, 此方法用于 cache 增量更新,需要注意 modifyTime 应为数据库时间戳
func (PostgresqlStore) GetMoreInstances ¶
func (ins PostgresqlStore) GetMoreInstances(tx store.Tx, mtime time.Time, firstUpdate, needMeta bool, serviceID []string) (map[string]*model.Instance, error)
GetMoreInstances 根据mtime获取增量修改数据 这里会返回所有的数据的,包括valid=false的数据 对于首次拉取,firstUpdate=true,只会拉取flag!=1的数据
func (PostgresqlStore) GetMoreL5Extend ¶
func (l5 PostgresqlStore) GetMoreL5Extend(mtime time.Time) (map[string]map[string]interface{}, error)
GetMoreL5Extend 获取更多的增量数据
func (PostgresqlStore) GetMoreL5IPConfigs ¶
GetMoreL5IPConfigs 获取更多的L5 IPConfig信息
func (PostgresqlStore) GetMoreL5Policies ¶
GetMoreL5Policies 获取更多的L5 Policy信息
func (PostgresqlStore) GetMoreL5Routes ¶
GetMoreL5Routes 获取更多的L5 Route信息
func (PostgresqlStore) GetMoreL5Sections ¶
GetMoreL5Sections 获取更多的L5 Section信息
func (PostgresqlStore) GetMoreNamespaces ¶
GetMoreNamespaces 根据mtime获取命名空间
func (PostgresqlStore) GetMoreReleaseFile ¶
func (cfr PostgresqlStore) GetMoreReleaseFile(firstUpdate bool, modifyTime time.Time) ([]*model.ConfigFileRelease, error)
GetMoreReleaseFile 获取最近更新的配置文件发布, 此方法用于 cache 增量更新,需要注意 modifyTime 应为数据库时间戳
func (PostgresqlStore) GetMoreServiceContracts ¶
func (s PostgresqlStore) GetMoreServiceContracts(firstUpdate bool, mtime time.Time) ([]*model.EnrichServiceContract, error)
GetMoreServiceContracts 查询服务契约数据
func (PostgresqlStore) GetMoreServices ¶
func (ss PostgresqlStore) GetMoreServices(mtime time.Time, firstUpdate, disableBusiness, needMeta bool) ( map[string]*model.Service, error)
GetMoreServices 根据modify_time获取增量数据
func (PostgresqlStore) GetNamespace ¶
GetNamespace 根据名字获取命名空间详情,只返回有效的
func (PostgresqlStore) GetNamespaces ¶
func (ns PostgresqlStore) GetNamespaces(filter map[string][]string, offset, limit int) ([]*model.Namespace, uint32, error)
GetNamespaces 根据过滤条件查询命名空间及数目
func (PostgresqlStore) GetRateLimitWithID ¶
GetRateLimitWithID 根据限流规则ID获取限流规则
func (PostgresqlStore) GetRateLimitsForCache ¶
func (rls PostgresqlStore) GetRateLimitsForCache(mtime time.Time, firstUpdate bool) ([]*model.RateLimit, error)
GetRateLimitsForCache 根据修改时间拉取增量限流规则及最新版本号
func (PostgresqlStore) GetRoutingConfigV2WithID ¶
func (r PostgresqlStore) GetRoutingConfigV2WithID(ruleID string) (*model.RouterConfig, error)
GetRoutingConfigV2WithID Pull the routing configuration according to the rules ID
func (PostgresqlStore) GetRoutingConfigV2WithIDTx ¶
func (r PostgresqlStore) GetRoutingConfigV2WithIDTx(tx store.Tx, ruleID string) (*model.RouterConfig, error)
GetRoutingConfigV2WithIDTx Pull the routing configuration according to the rules ID
func (PostgresqlStore) GetRoutingConfigWithID ¶
func (rs PostgresqlStore) GetRoutingConfigWithID(id string) (*model.RoutingConfig, error)
GetRoutingConfigWithID 根据服务ID获取对应的配置
func (PostgresqlStore) GetRoutingConfigWithService ¶
func (rs PostgresqlStore) GetRoutingConfigWithService(name string, namespace string) (*model.RoutingConfig, error)
GetRoutingConfigWithService 根据服务名+namespace获取对应的配置
func (PostgresqlStore) GetRoutingConfigs ¶
func (rs PostgresqlStore) GetRoutingConfigs(filter map[string]string, offset uint32, limit uint32) (uint32, []*model.ExtendRoutingConfig, error)
GetRoutingConfigs 获取路由配置列表
func (PostgresqlStore) GetRoutingConfigsForCache ¶
func (rs PostgresqlStore) GetRoutingConfigsForCache(mtime time.Time, firstUpdate bool) ([]*model.RoutingConfig, error)
GetRoutingConfigsForCache 缓存增量拉取
func (PostgresqlStore) GetRoutingConfigsV2ForCache ¶
func (r PostgresqlStore) GetRoutingConfigsV2ForCache( mtime time.Time, firstUpdate bool) ([]*model.RouterConfig, error)
GetRoutingConfigsV2ForCache Pull the incremental routing configuration information through mtime
func (PostgresqlStore) GetService ¶
GetService 获取服务详情,只返回有效的数据
func (PostgresqlStore) GetServiceAliases ¶
func (ss PostgresqlStore) GetServiceAliases(filter map[string]string, offset uint32, limit uint32) (uint32, []*model.ServiceAlias, error)
GetServiceAliases 获取服务别名列表
func (PostgresqlStore) GetServiceByID ¶
GetServiceByID 根据服务ID查询服务详情
func (PostgresqlStore) GetServiceContract ¶
func (s PostgresqlStore) GetServiceContract(id string) (data *model.EnrichServiceContract, err error)
GetServiceContract 通过ID查询服务契约数据
func (PostgresqlStore) GetServices ¶
func (ss PostgresqlStore) GetServices(serviceFilters, serviceMetas map[string]string, instanceFilters *store.InstanceArgs, offset, limit uint32) (uint32, []*model.Service, error)
GetServices 根据相关条件查询对应服务及数目,不包括别名
func (PostgresqlStore) GetServicesBatch ¶
GetServicesBatch 查询多个服务的id
func (PostgresqlStore) GetServicesCount ¶
GetServicesCount 获取所有服务总数
func (PostgresqlStore) GetSourceServiceToken ¶
func (ss PostgresqlStore) GetSourceServiceToken(name string, namespace string) (*model.Service, error)
GetSourceServiceToken 获取只获取服务token 返回服务ID,服务token
func (PostgresqlStore) GetStrategies ¶
func (s PostgresqlStore) GetStrategies(filters map[string]string, offset uint32, limit uint32) (uint32, []*model.StrategyDetail, error)
GetStrategies 获取策略列表
func (PostgresqlStore) GetStrategyDetail ¶
func (s PostgresqlStore) GetStrategyDetail(id string) (*model.StrategyDetail, error)
GetStrategyDetail 获取策略详情
func (PostgresqlStore) GetStrategyDetailsForCache ¶
func (PostgresqlStore) GetStrategyResources ¶
func (s PostgresqlStore) GetStrategyResources(principalId string, principalRole model.PrincipalType) ([]model.StrategyResource, error)
GetStrategyResources 获取对应 principal 能操作的所有资源
func (PostgresqlStore) GetSubCount ¶
GetSubCount get user's sub count
func (PostgresqlStore) GetSystemServices ¶
GetSystemServices 获取系统服务
func (PostgresqlStore) GetUnHealthyInstances ¶
func (m PostgresqlStore) GetUnHealthyInstances(timeout time.Duration, limit uint32) ([]string, error)
GetUnHealthyInstances 获取实例
func (PostgresqlStore) GetUnixSecond ¶
GetUnixSecond 获取当前时间,单位秒
func (PostgresqlStore) GetUserByIds ¶
GetUserByIds Get user list data according to user ID
func (PostgresqlStore) GetUserByName ¶
GetUserByName 根据用户名、owner 获取用户
func (PostgresqlStore) GetUsers ¶
func (u PostgresqlStore) GetUsers(filters map[string]string, offset uint32, limit uint32) (uint32, []*model.User, error)
GetUsers Query user list information Case 1. From the user's perspective, normal query conditions Case 2. From the perspective of the user group, query is the list of users involved under a user group.
func (PostgresqlStore) GetUsersForCache ¶
GetUsersForCache Get user information, mainly for cache
func (PostgresqlStore) HasCircuitBreakerRule ¶
HasCircuitBreakerRule check circuitbreaker rule exists
func (PostgresqlStore) HasCircuitBreakerRuleByName ¶
HasCircuitBreakerRuleByName check circuitbreaker rule exists by name
func (PostgresqlStore) HasCircuitBreakerRuleByNameExcludeId ¶
func (c PostgresqlStore) HasCircuitBreakerRuleByNameExcludeId( name string, namespace string, id string) (bool, error)
HasCircuitBreakerRuleByNameExcludeId check circuitbreaker rule exists by name exclude id
func (PostgresqlStore) HasFaultDetectRule ¶
HasFaultDetectRule check fault detect rule exists
func (PostgresqlStore) HasFaultDetectRuleByName ¶
HasFaultDetectRuleByName check fault detect rule exists by name
func (PostgresqlStore) HasFaultDetectRuleByNameExcludeId ¶
func (f PostgresqlStore) HasFaultDetectRuleByNameExcludeId( name string, namespace string, id string) (bool, error)
HasFaultDetectRuleByNameExcludeId check fault detect rule exists by name not this id
func (PostgresqlStore) InactiveConfigFileReleaseTx ¶
func (cfr PostgresqlStore) InactiveConfigFileReleaseTx(tx store.Tx, release *model.ConfigFileRelease) error
InactiveConfigFileReleaseTx deactivates the specified config file release within a transaction.
func (*PostgresqlStore) Initialize ¶
func (p *PostgresqlStore) Initialize(conf *store.Config) error
Initialize 初始化函数
func (PostgresqlStore) ListLeaderElections ¶
func (m PostgresqlStore) ListLeaderElections() ([]*model.LeaderElection, error)
ListLeaderElections leader选举列表
func (PostgresqlStore) LockConfigFile ¶
func (cf PostgresqlStore) LockConfigFile(tx store.Tx, file *model.ConfigFileKey) (*model.ConfigFile, error)
LockConfigFile 加锁配置文件
func (PostgresqlStore) LooseAddStrategyResources ¶
func (s PostgresqlStore) LooseAddStrategyResources(resources []model.StrategyResource) error
LooseAddStrategyResources loose add strategy resources
func (PostgresqlStore) QueryAllConfigFileTemplates ¶
func (cf PostgresqlStore) QueryAllConfigFileTemplates() ([]*model.ConfigFileTemplate, error)
QueryAllConfigFileTemplates query all config file templates
func (PostgresqlStore) QueryConfigFileReleaseHistories ¶
func (rh PostgresqlStore) QueryConfigFileReleaseHistories(filter map[string]string, offset, limit uint32) (uint32, []*model.ConfigFileReleaseHistory, error)
QueryConfigFileReleaseHistories 获取配置文件的发布历史记录
func (PostgresqlStore) QueryConfigFiles ¶
func (cf PostgresqlStore) QueryConfigFiles(filter map[string]string, offset, limit uint32) (uint32, []*model.ConfigFile, error)
QueryConfigFiles 翻页查询配置文件,group、name可为模糊匹配
func (PostgresqlStore) ReleaseLeaderElection ¶
ReleaseLeaderElection 释放选举锁
func (PostgresqlStore) RemoveStrategyResources ¶
func (s PostgresqlStore) RemoveStrategyResources(resources []model.StrategyResource) error
RemoveStrategyResources 删除策略的资源
func (PostgresqlStore) SetInstanceHealthStatus ¶
func (ins PostgresqlStore) SetInstanceHealthStatus(instanceID string, flag int, revision string) error
SetInstanceHealthStatus 设置实例健康状态
func (PostgresqlStore) SetL5Extend ¶
func (l5 PostgresqlStore) SetL5Extend(serviceID string, meta map[string]interface{}) (map[string]interface{}, error)
SetL5Extend 保存L5扩展数据
func (PostgresqlStore) StartLeaderElection ¶
StartLeaderElection 开始leader选举
func (*PostgresqlStore) StartReadTx ¶
func (p *PostgresqlStore) StartReadTx() (store.Tx, error)
func (PostgresqlStore) StopLeaderElections ¶
func (m PostgresqlStore) StopLeaderElections()
StopLeaderElections 停止leader选举
func (PostgresqlStore) UpdateCircuitBreakerRule ¶
func (c PostgresqlStore) UpdateCircuitBreakerRule(cbRule *model.CircuitBreakerRule) error
UpdateCircuitBreakerRule 更新熔断规则
func (PostgresqlStore) UpdateClient ¶
UpdateClient update the client info
func (PostgresqlStore) UpdateConfigFileGroup ¶
func (fg PostgresqlStore) UpdateConfigFileGroup(fileGroup *model.ConfigFileGroup) error
UpdateConfigFileGroup 更新配置文件组信息
func (PostgresqlStore) UpdateConfigFileTx ¶
func (cf PostgresqlStore) UpdateConfigFileTx(tx store.Tx, file *model.ConfigFile) error
UpdateConfigFileTx 更新配置文件
func (PostgresqlStore) UpdateFaultDetectRule ¶
func (f PostgresqlStore) UpdateFaultDetectRule(fdRule *model.FaultDetectRule) error
UpdateFaultDetectRule update fault detect rule
func (PostgresqlStore) UpdateGroup ¶
func (u PostgresqlStore) UpdateGroup(group *model.ModifyUserGroup) error
UpdateGroup 更新用户组
func (PostgresqlStore) UpdateInstance ¶
UpdateInstance 更新实例
func (PostgresqlStore) UpdateNamespace ¶
UpdateNamespace 更新命名空间,目前只更新owner
func (PostgresqlStore) UpdateNamespaceToken ¶
UpdateNamespaceToken 更新命名空间token
func (PostgresqlStore) UpdateRateLimit ¶
UpdateRateLimit 更新限流规则
func (PostgresqlStore) UpdateRoutingConfig ¶
func (rs PostgresqlStore) UpdateRoutingConfig(conf *model.RoutingConfig) error
UpdateRoutingConfig 更新
func (PostgresqlStore) UpdateRoutingConfigV2 ¶
func (r PostgresqlStore) UpdateRoutingConfigV2(conf *model.RouterConfig) error
UpdateRoutingConfigV2 Update a routing configuration
func (PostgresqlStore) UpdateRoutingConfigV2Tx ¶
func (r PostgresqlStore) UpdateRoutingConfigV2Tx(tx store.Tx, conf *model.RouterConfig) error
func (PostgresqlStore) UpdateService ¶
UpdateService 更新完整的服务信息
func (PostgresqlStore) UpdateServiceAlias ¶
UpdateServiceAlias 更新服务别名
func (PostgresqlStore) UpdateServiceContract ¶
func (s PostgresqlStore) UpdateServiceContract(contract *model.ServiceContract) error
UpdateServiceContract 更新服务契约信息
func (PostgresqlStore) UpdateServiceToken ¶
UpdateServiceToken 更新服务token
func (PostgresqlStore) UpdateStrategy ¶
func (s PostgresqlStore) UpdateStrategy(strategy *model.ModifyStrategyDetail) error
UpdateStrategy 更新鉴权规则
func (PostgresqlStore) UpdateUser ¶
UpdateUser 更新用户信息
type QueryHandler ¶
QueryHandler is the interface that wraps the basic Query method.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) CreateReadView ¶
func (*Tx) GetDelegateTx ¶
func (t *Tx) GetDelegateTx() interface{}
Source Files ¶
- admin.go
- base_db.go
- circuitbreaker_config_v2.go
- client.go
- common.go
- config_file.go
- config_file_group.go
- config_file_release.go
- config_file_release_history.go
- config_file_template.go
- default.go
- fault_detect_config.go
- gray_resouce.go
- group.go
- instance.go
- l5.go
- log.go
- namespace.go
- ratelimit_config.go
- routing_config.go
- routing_config_v2.go
- service.go
- service_contract.go
- sql.go
- strategy.go
- tool.go
- transaction.go
- tx.go
- user.go