Documentation ¶
Overview ¶
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func Accessible(ctx context.Context, consumerID string, providerID string) *scerr.Error
- func AddDependencyRule(ctx context.Context, dep *Dependency) error
- func AddServiceVersionRule(ctx context.Context, domainProject string, consumer *pb.MicroService, ...) error
- func AddTagIntoETCD(ctx context.Context, domainProject string, serviceID string, ...) *scerr.Error
- func AllowAcrossDimension(ctx context.Context, providerService *pb.MicroService, ...) error
- func AppendFindResponse(ctx context.Context, index int64, resp *pb.Response, ...)
- func AtLess(sorted []string, kvs map[string]*discovery.KeyValue, start, end string) []string
- func BadParamsResponse(detailErr string) *pb.CreateDependenciesResponse
- func CheckSchemaInfoExist(ctx context.Context, key string) (bool, error)
- func CleanUpDependencyRules(ctx context.Context, domainProject string) error
- func CreateDependencyRule(ctx context.Context, dep *Dependency) error
- func DeleteDependencyForDeleteService(domainProject string, serviceID string, service *pb.MicroServiceKey) (registry.PluginOp, error)
- func DeleteServiceAllInstances(ctx context.Context, serviceID string) error
- func DependencyRuleExist(ctx context.Context, provider *pb.MicroServiceKey, ...) (bool, error)
- func DomainExist(ctx context.Context, domain string) (bool, error)
- func FindServiceIds(ctx context.Context, versionRule string, key *pb.MicroServiceKey) ([]string, bool, error)
- func FormatRevision(revs, counts []int64) (s string)
- func FromContext(ctx context.Context) []registry.PluginOpOption
- func GetAllConsumerIds(ctx context.Context, domainProject string, provider *pb.MicroService) (allow []string, deny []string, _ error)
- func GetAllDomain(ctx context.Context) ([]string, error)
- func GetAllDomainRawData(ctx context.Context) ([]*discovery.KeyValue, error)
- func GetAllInstancesOfOneService(ctx context.Context, domainProject string, serviceID string) ([]*pb.MicroServiceInstance, error)
- func GetAllProviderIds(ctx context.Context, domainProject string, service *pb.MicroService) (allow []string, deny []string, _ error)
- func GetAllServiceUtil(ctx context.Context) ([]*pb.MicroService, error)
- func GetAllServicesAcrossDomainProject(ctx context.Context) (map[string][]*pb.MicroService, error)
- func GetConsumerIds(ctx context.Context, domainProject string, provider *pb.MicroService) ([]string, error)
- func GetInstance(ctx context.Context, domainProject string, serviceID string, instanceID string) (*pb.MicroServiceInstance, error)
- func GetInstanceCountOfOneService(ctx context.Context, domainProject string, serviceID string) (int64, error)
- func GetLeaseID(ctx context.Context, domainProject string, serviceID string, instanceID string) (int64, error)
- func GetOneDomainProjectInstanceCount(ctx context.Context, domainProject string) (int64, error)
- func GetOneDomainProjectServiceCount(ctx context.Context, domainProject string) (int64, error)
- func GetOneRule(ctx context.Context, domainProject, serviceID, ruleID string) (*pb.ServiceRule, error)
- func GetProviderIds(ctx context.Context, domainProject string, consumer *pb.MicroService) ([]string, error)
- func GetRulesUtil(ctx context.Context, domainProject string, serviceID string) ([]*pb.ServiceRule, error)
- func GetService(ctx context.Context, domainProject string, serviceID string) (*pb.MicroService, error)
- func GetServiceAllVersions(ctx context.Context, key *pb.MicroServiceKey, alias bool) (*discovery.Response, error)
- func GetServiceFromCache(domainProject string, serviceID string) *pb.MicroService
- func GetServiceID(ctx context.Context, key *pb.MicroServiceKey) (serviceID string, err error)
- func GetServiceRuleType(ctx context.Context, domainProject string, serviceID string) (string, int, error)
- func GetServiceWithRev(ctx context.Context, domain string, id string, rev int64) (*pb.MicroService, error)
- func GetServicesByDomainProject(ctx context.Context, domainProject string) ([]*pb.MicroService, error)
- func GetTagsUtils(ctx context.Context, domainProject, serviceID string) (tags map[string]string, err error)
- func HeartbeatUtil(ctx context.Context, domainProject string, serviceID string, instanceID string) (leaseID int64, ttl int64, _ *scerr.Error)
- func KeepAliveLease(ctx context.Context, domainProject, serviceID, instanceID string, ...) (ttl int64, err error)
- func Larger(start, end string) bool
- func Latest(sorted []string, kvs map[string]*discovery.KeyValue, start, end string) []string
- func LessEqual(start, end string) bool
- func MatchRules(rulesOfProvider []*pb.ServiceRule, consumer *pb.MicroService, ...) *scerr.Error
- func NewDomain(ctx context.Context, domain string) (bool, error)
- func NewDomainProject(ctx context.Context, domain, project string) error
- func NewProject(ctx context.Context, domain, project string) (bool, error)
- func ParamsChecker(consumerInfo *pb.MicroServiceKey, providersInfo []*pb.MicroServiceKey) *pb.CreateDependenciesResponse
- func ParseVersionRule(versionRule string) func(kvs []*discovery.KeyValue) []string
- func ProjectExist(ctx context.Context, domain, project string) (bool, error)
- func QueryAllProvidersInstances(ctx context.Context, selfServiceID string) (results []*pb.WatchInstanceResponse, rev int64)
- func Range(sorted []string, kvs map[string]*discovery.KeyValue, start, end string) []string
- func RemandInstanceQuota(ctx context.Context)
- func RemandServiceQuota(ctx context.Context)
- func RuleExist(ctx context.Context, domainProject string, serviceID string, attr string, ...) bool
- func ServiceExist(ctx context.Context, domainProject string, serviceID string) bool
- func SetServiceDefaultValue(service *pb.MicroService)
- func TransferToMicroServiceDependency(ctx context.Context, key string) (*pb.MicroServiceDependency, error)
- func UpdateInstance(ctx context.Context, domainProject string, instance *pb.MicroServiceInstance) *scerr.Error
- func UpdateService(domainProject string, serviceID string, service *pb.MicroService) (opt registry.PluginOp, err error)
- func VersionMatchRule(version string, versionRule string) bool
- func VersionToInt64(versionStr string) (ret int64, err error)
- type Dependency
- type DependencyRelation
- func NewConsumerDependencyRelation(ctx context.Context, domainProject string, consumer *pb.MicroService) *DependencyRelation
- func NewDependencyRelation(ctx context.Context, domainProject string, consumer *pb.MicroService, ...) *DependencyRelation
- func NewProviderDependencyRelation(ctx context.Context, domainProject string, provider *pb.MicroService) *DependencyRelation
- func (dr *DependencyRelation) GetDependencyConsumerIds() ([]string, error)
- func (dr *DependencyRelation) GetDependencyConsumers(opts ...DependencyRelationFilterOption) ([]*pb.MicroService, error)
- func (dr *DependencyRelation) GetDependencyProviderIds() ([]string, error)
- func (dr *DependencyRelation) GetDependencyProviders(opts ...DependencyRelationFilterOption) ([]*pb.MicroService, error)
- type DependencyRelationFilterOpt
- type DependencyRelationFilterOption
- type EndpointIndexValue
- type RuleFilter
- type VersionRegexp
- type VersionRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Accessible ¶
func AddDependencyRule ¶
func AddDependencyRule(ctx context.Context, dep *Dependency) error
func AddServiceVersionRule ¶
func AddServiceVersionRule(ctx context.Context, domainProject string, consumer *pb.MicroService, provider *pb.MicroServiceKey) error
func AddTagIntoETCD ¶
func AllowAcrossDimension ¶
func AllowAcrossDimension(ctx context.Context, providerService *pb.MicroService, consumerService *pb.MicroService) error
func AppendFindResponse ¶
func AppendFindResponse(ctx context.Context, index int64, resp *pb.Response, instances []*pb.MicroServiceInstance, updatedResult *[]*pb.FindResult, notModifiedResult *[]int64, failedResult **pb.FindFailedResult)
func BadParamsResponse ¶
func BadParamsResponse(detailErr string) *pb.CreateDependenciesResponse
func CheckSchemaInfoExist ¶
func CleanUpDependencyRules ¶
func CreateDependencyRule ¶
func CreateDependencyRule(ctx context.Context, dep *Dependency) error
func DependencyRuleExist ¶
func DependencyRuleExist(ctx context.Context, provider *pb.MicroServiceKey, consumer *pb.MicroServiceKey) (bool, error)
func FindServiceIds ¶
func FormatRevision ¶
func FromContext ¶
func FromContext(ctx context.Context) []registry.PluginOpOption
func GetAllConsumerIds ¶
func GetAllConsumerIds(ctx context.Context, domainProject string, provider *pb.MicroService) (allow []string, deny []string, _ error)
GetAllConsumerIds is the function get from dependency rule and filter with service rules
func GetAllDomainRawData ¶
func GetAllProviderIds ¶
func GetAllServiceUtil ¶
func GetAllServiceUtil(ctx context.Context) ([]*pb.MicroService, error)
func GetAllServicesAcrossDomainProject ¶
GetAllServicesAcrossDomainProject get services of all domains, projects the map's key is domainProject
func GetConsumerIds ¶
func GetInstance ¶
func GetLeaseID ¶
func GetOneRule ¶
func GetProviderIds ¶
func GetRulesUtil ¶
func GetService ¶
func GetServiceAllVersions ¶
func GetServiceFromCache ¶
func GetServiceFromCache(domainProject string, serviceID string) *pb.MicroService
GetServiceFromCache gets service from cache
func GetServiceID ¶
func GetServiceRuleType ¶
func GetServiceWithRev ¶
func GetServiceWithRev(ctx context.Context, domain string, id string, rev int64) (*pb.MicroService, error)
get Service by service id
func GetTagsUtils ¶
func HeartbeatUtil ¶
func KeepAliveLease ¶
func MatchRules ¶
func MatchRules(rulesOfProvider []*pb.ServiceRule, consumer *pb.MicroService, tagsOfConsumer map[string]string) *scerr.Error
func ParamsChecker ¶
func ParamsChecker(consumerInfo *pb.MicroServiceKey, providersInfo []*pb.MicroServiceKey) *pb.CreateDependenciesResponse
func ParseVersionRule ¶
func RemandInstanceQuota ¶
func RemandServiceQuota ¶
func ServiceExist ¶
func SetServiceDefaultValue ¶
func SetServiceDefaultValue(service *pb.MicroService)
func UpdateInstance ¶
func UpdateService ¶
func VersionMatchRule ¶
func VersionToInt64 ¶
Types ¶
type Dependency ¶
type Dependency struct { DomainProject string // store the consumer Dependency from dep-queue object Consumer *rmodel.MicroServiceKey ProvidersRule []*rmodel.MicroServiceKey // store the parsed rules from Dependency object DeleteDependencyRuleList []*rmodel.MicroServiceKey CreateDependencyRuleList []*rmodel.MicroServiceKey }
type DependencyRelation ¶
type DependencyRelation struct {
// contains filtered or unexported fields
}
func NewConsumerDependencyRelation ¶
func NewConsumerDependencyRelation(ctx context.Context, domainProject string, consumer *pb.MicroService) *DependencyRelation
func NewDependencyRelation ¶
func NewDependencyRelation(ctx context.Context, domainProject string, consumer *pb.MicroService, provider *pb.MicroService) *DependencyRelation
func NewProviderDependencyRelation ¶
func NewProviderDependencyRelation(ctx context.Context, domainProject string, provider *pb.MicroService) *DependencyRelation
func (*DependencyRelation) GetDependencyConsumerIds ¶
func (dr *DependencyRelation) GetDependencyConsumerIds() ([]string, error)
func (*DependencyRelation) GetDependencyConsumers ¶
func (dr *DependencyRelation) GetDependencyConsumers(opts ...DependencyRelationFilterOption) ([]*pb.MicroService, error)
func (*DependencyRelation) GetDependencyProviderIds ¶
func (dr *DependencyRelation) GetDependencyProviderIds() ([]string, error)
func (*DependencyRelation) GetDependencyProviders ¶
func (dr *DependencyRelation) GetDependencyProviders(opts ...DependencyRelationFilterOption) ([]*pb.MicroService, error)
type DependencyRelationFilterOption ¶
type DependencyRelationFilterOption func(opt DependencyRelationFilterOpt) DependencyRelationFilterOpt
func WithSameDomainProject ¶
func WithSameDomainProject() DependencyRelationFilterOption
func WithoutSelfDependency ¶
func WithoutSelfDependency() DependencyRelationFilterOption
type EndpointIndexValue ¶
type EndpointIndexValue struct {
// contains filtered or unexported fields
}
func ParseEndpointIndexValue ¶
func ParseEndpointIndexValue(value []byte) EndpointIndexValue
type RuleFilter ¶
type RuleFilter struct { DomainProject string ProviderRules []*pb.ServiceRule }
type VersionRegexp ¶
func NewVersionRegexp ¶
func NewVersionRegexp(fuzzy bool) (vr *VersionRegexp)
func (*VersionRegexp) MatchString ¶
func (vr *VersionRegexp) MatchString(s string) bool
func (*VersionRegexp) String ¶
func (vr *VersionRegexp) String() string