Versions in this module Expand all Collapse all v1 v1.5.4 Oct 26, 2023 Changes in this version + const ArgumentTypeCallerIP + const ArgumentTypeCallerService + const ArgumentTypeCookie + const ArgumentTypeCustom + const ArgumentTypeHeader + const ArgumentTypeMethod + const ArgumentTypePath + const ArgumentTypeQuery + const BaseIndexErrCode + const BaseSDKInternalErrCode + const BaseServerErrCode + const CanaryMetaKey + const CanaryMetadataEnable + const ContextKeyEngine + const ContextKeyFinishInitTime + const ContextKeyPlugins + const ContextKeySelfIP + const ContextKeyTakeEffectTime + const ContextKeyToken + const DefaultHeartbeatTtl + const ErrCodeDiskError + const HealthCheckTypeHeartBeat + const HomeVar + const LabelKeyCallerIp + const LabelKeyCallerService + const LabelKeyCookie + const LabelKeyHeader + const LabelKeyMethod + const LabelKeyPath + const LabelKeyQuery + const LocationEmpty + const LocationError + const LocationInit + const LocationReady + const MaxPriority + const MaxWeight + const MeshDestinationRule + const MeshEnvoyFilter + const MeshGateway + const MeshServiceEntry + const MeshVirtualService + const MinPriority + const MinWeight + const ModeNoAgent + const ModeWithAgent + const NearbyMetadataEnable + const RateLimitGlobal + const RateLimitLocal + const RetCodeDivFactor + const ServerExceptionRetCode + const SuccessRetCode + var MeshKeyLen = 3 + var MeshKeySpliter = "MESHa071a34fecSPLITER" + var MeshPrefix = "mesh_resource" + func ConvertDuration(d *duration.Duration) (time.Duration, error) + func CurrentMicrosecond() int64 + func CurrentMillisecond() int64 + func CurrentNanosecond() int64 + func DescMetricType(t MetricType) string + func EnsureAndVerifyDir(dir string) error + func ErrCodeToString(ec ErrCode) string + func GetCrc64Hash(value string) (uint64, error) + func GetIP(name string) (string, error) + func HashMessage(message proto.Message) uint64 + func HashStr(key string) (uint64, error) + func IsDir(path string) bool + func IsFile(path string) bool + func IsInstanceAvailable(instance Instance) bool + func IsNearbyMatch(dst, src string) bool + func IsServerException(retCode uint32) bool + func IsSuccessResultCode(retCode uint32) bool + func ParseMilliSeconds(v int64) int64 + func PathExist(path string) bool + func PoolGetByteBuffer(size int) *bytes.Buffer + func PoolGetStringSlice(size int) []string + func PoolPutByteBuffer(size int, buf *bytes.Buffer) + func PoolPutStringSlice(size int, slice []string) + func ProtoDurationToMS(dur *duration.Duration) int64 + func ReplaceHomeVar(path string) string + func SortMap(values map[string]string, keys []string) ([]string, int) + func TimestampMsToUtcIso8601(timestamp int64) string + func ToBoolPtr(v bool) *bool + func ToDurationPtr(v time.Duration) *time.Duration + func ToMilliSeconds(v time.Duration) int64 + func ToNetIP(val uint32) net.IP + func ToStringService(svc ServiceMetadata, printMeta bool) string + func ValidMetircType(t MetricType) bool + type APICallKey struct + APIName ApiOperation + DelayRange ApiDelayRange + RetCode ErrCode + type APICallResult struct + RetStatus RetStatus + func (a *APICallResult) GetAPI() ApiOperation + func (a *APICallResult) GetDelay() *time.Duration + func (a *APICallResult) GetDelayRange() ApiDelayRange + func (a *APICallResult) GetRetCode() *int32 + func (a *APICallResult) GetRetCodeValue() int32 + func (a *APICallResult) GetRetStatus() RetStatus + func (a *APICallResult) SetDelay(delay time.Duration) + func (a *APICallResult) SetFail(retCode ErrCode, delay time.Duration) + func (a *APICallResult) SetSuccess(delay time.Duration) + type ActiveDetectStatus interface + GetStartTime func() time.Time + GetStatus func() HealthCheckStatus + type ApiDelayRange int + const ApiDelayBelow100 + const ApiDelayBelow150 + const ApiDelayBelow200 + const ApiDelayBelow50 + const ApiDelayMax + const ApiDelayOver200 + func GetApiDelayRange(delay time.Duration) ApiDelayRange + func (a ApiDelayRange) String() string + type ApiOperation int + const ApiDeregister + const ApiGetAllInstances + const ApiGetInstances + const ApiGetOneInstance + const ApiGetQuota + const ApiGetRouteRule + const ApiHeartbeat + const ApiInitCalleeServices + const ApiOperationMax + const ApiProcessLoadBalance + const ApiProcessRouters + const ApiRegister + const ApiServices + const ApiUpdateServiceCallResult + func (a ApiOperation) String() string + type Argument struct + func BuildArgumentFromLabel(labelKey string, labelValue string) Argument + func BuildCallerIPArgument(callerIP string) Argument + func BuildCallerServiceArgument(namespace string, service string) Argument + func BuildCookieArgument(key, value string) Argument + func BuildCustomArgument(key string, value string) Argument + func BuildHeaderArgument(key string, value string) Argument + func BuildMethodArgument(method string) Argument + func BuildPathArgument(path string) Argument + func BuildQueryArgument(key string, value string) Argument + func (a Argument) ArgumentType() int + func (a Argument) Key() string + func (a Argument) String() string + func (a Argument) ToLabels(labels map[string]string) + func (a Argument) Value() string + type CacheValueQuery interface + GetCallResult func() *APICallResult + GetControlParam func() *ControlParam + GetDstService func() *ServiceKey + GetNotifierTrigger func() *NotifyTrigger + GetSrcService func() *ServiceKey + SetDstInstances func(instances ServiceInstances) + SetDstRateLimit func(rule ServiceRule) + SetDstRoute func(rule ServiceRule) + SetServices func(mc Services) + SetSrcRoute func(rule ServiceRule) + type ChangeType int + const Added + const Deleted + const Modified + const NotChanged + type CircuitBreakGauge struct + CBStatus CircuitBreakerStatus + ChangeInstance Instance + Method string + func (cbg *CircuitBreakGauge) GetCalledInstance() Instance + func (cbg *CircuitBreakGauge) GetCircuitBreakerStatus() CircuitBreakerStatus + func (cbg *CircuitBreakGauge) Validate() error + type CircuitBreakerStatus interface + AcquireStatusLock func() bool + AddRequestCountAfterHalfOpen func(n int32, success bool) int32 + Allocate func() bool + AllocatedRequestsAfterHalfOpen func() int32 + GetCircuitBreaker func() string + GetFailRequestsAfterHalfOpen func() int32 + GetFinalAllocateTimeInt64 func() int64 + GetRequestsAfterHalfOpen func() int32 + GetStartTime func() time.Time + GetStatus func() Status + IsAvailable func() bool + type Cluster struct + HasLimitedInstances bool + IncludeHalfOpen bool + LocationMatchInfo string + MetaCount int + Metadata map[string]map[string]string + MissLocationInstances bool + func NewCluster(clusters ServiceClusters, cls *Cluster) *Cluster + func (c *Cluster) AddMetadata(key string, value string) bool + func (c *Cluster) ClearClusterValue() + func (c *Cluster) GetAllInstances() ([]Instance, int) + func (c *Cluster) GetClusterValue() *ClusterValue + func (c *Cluster) GetClusters() ServiceClusters + func (c *Cluster) GetContainMetaKeyClusterValue() *ClusterValue + func (c *Cluster) GetContainNotMatchMetaKeyClusterValue() *ClusterValue + func (c *Cluster) GetInstances() ([]Instance, int) + func (c *Cluster) GetInstancesWhenSkipRouteFilter() ([]Instance, int) + func (c *Cluster) GetNotContainMetaKeyClusterValue() *ClusterValue + func (c *Cluster) MatchContainMetaKeyData(instance Instance) bool + func (c *Cluster) PoolPut() + func (c *Cluster) ReloadComposeMetaValue() + func (c *Cluster) RuleAddMetadata(key string, value string, composedValue string) bool + func (c *Cluster) SetReuse(value bool) + func (c Cluster) String() string + type ClusterEventHandler struct + PostClusterValueBuilt func(value *ClusterValue) + type ClusterKey struct + ComposeMetaValue string + Location Location + func (k ClusterKey) String() string + type ClusterOwner interface + GetCluster func() *Cluster + type ClusterValue struct + func (v *ClusterValue) Count() int + func (v *ClusterValue) GetAllInstanceSet() *InstanceSet + func (v *ClusterValue) GetInstancesSet(hasLimitedInstances bool, includeHalfOpen bool) *InstanceSet + func (v *ClusterValue) GetInstancesSetWhenSkipRouteFilter(hasLimitedInstances bool, includeHalfOpen bool) *InstanceSet + func (v ClusterValue) String() string + type ConfigFile interface + AddChangeListener func(cb OnConfigFileChange) + AddChangeListenerWithChannel func() <-chan ConfigFileChangeEvent + GetContent func() string + HasContent func() bool + type ConfigFileChangeEvent struct + ChangeType ChangeType + ConfigFileMetadata ConfigFileMetadata + NewValue string + OldValue string + type ConfigFileMetadata interface + GetFileGroup func() string + GetFileName func() string + GetNamespace func() string + type ConfigMode int + const ConfigQuotaGlobalMode + const ConfigQuotaLocalMode + type ControlParam struct + MaxRetry int + RetryInterval time.Duration + Timeout time.Duration + type DefaultConfigFileMetadata struct + FileGroup string + FileName string + Namespace string + func (m *DefaultConfigFileMetadata) GetFileGroup() string + func (m *DefaultConfigFileMetadata) GetFileName() string + func (m *DefaultConfigFileMetadata) GetNamespace() string + type DefaultInstance struct + Namespace string + Service string + type DefaultServiceInstances struct + func (d *DefaultServiceInstances) GetHashValue() uint64 + func (d *DefaultServiceInstances) GetInstance(id string) Instance + func (d *DefaultServiceInstances) GetInstances() []Instance + func (d *DefaultServiceInstances) GetMetadata() map[string]string + func (d *DefaultServiceInstances) GetNamespace() string + func (d *DefaultServiceInstances) GetRevision() string + func (d *DefaultServiceInstances) GetService() string + func (d *DefaultServiceInstances) GetServiceClusters() ServiceClusters + func (d *DefaultServiceInstances) GetTotalWeight() int + func (d *DefaultServiceInstances) GetType() EventType + func (d *DefaultServiceInstances) IsCacheLoaded() bool + func (d *DefaultServiceInstances) IsInitialized() bool + func (d *DefaultServiceInstances) IsNotExists() bool + func (d *DefaultServiceInstances) ReloadServiceClusters() + type EmptyInstanceGauge struct + func (e EmptyInstanceGauge) GetAPI() ApiOperation + func (e EmptyInstanceGauge) GetCalledInstance() Instance + func (e EmptyInstanceGauge) GetCircuitBreakerStatus() CircuitBreakerStatus + func (e EmptyInstanceGauge) GetDelay() *time.Duration + func (e EmptyInstanceGauge) GetDelayRange() ApiDelayRange + func (e EmptyInstanceGauge) GetHost() string + func (e EmptyInstanceGauge) GetNamespace() string + func (e EmptyInstanceGauge) GetPort() int + func (e EmptyInstanceGauge) GetRetCodeValue() int32 + func (e EmptyInstanceGauge) GetRetStatus() RetStatus + func (e EmptyInstanceGauge) GetService() string + func (e EmptyInstanceGauge) Validate() error + type Engine interface + AsyncGetQuota func(request *QuotaRequestImpl) (*QuotaFutureImpl, error) + Destroy func() error + GetContext func() ValueContext + InitCalleeService func(req *InitCalleeServiceRequest) error + ProcessLoadBalance func(req *ProcessLoadBalanceRequest) (*OneInstanceResponse, error) + ProcessRouters func(req *ProcessRoutersRequest) (*InstancesResponse, error) + ScheduleTask func(task *PeriodicTask) (chan<- *PriorityTask, TaskValues) + SyncDeregister func(instance *InstanceDeRegisterRequest) error + SyncGetAllInstances func(req *GetAllInstancesRequest) (*InstancesResponse, error) + SyncGetConfigFile func(namespace, fileGroup, fileName string) (ConfigFile, error) + SyncGetInstances func(req *GetInstancesRequest) (*InstancesResponse, error) + SyncGetOneInstance func(req *GetOneInstanceRequest) (*OneInstanceResponse, error) + SyncGetResources func(req CacheValueQuery) error + SyncGetServiceRule func(eventType EventType, req *GetServiceRuleRequest) (*ServiceRuleResponse, error) + SyncGetServices func(eventType EventType, req *GetServicesRequest) (*ServicesResponse, error) + SyncHeartbeat func(instance *InstanceHeartbeatRequest) error + SyncRegister func(instance *InstanceRegisterRequest) (*InstanceRegisterResponse, error) + SyncRegisterV2 func(Instance *InstanceRegisterRequest) (*InstanceRegisterResponse, error) + SyncReportStat func(typ MetricType, stat InstanceGauge) error + SyncUpdateServiceCallResult func(result *ServiceCallResult) error + WatchAllInstances func(request *WatchAllInstancesRequest) (*WatchAllInstancesResponse, error) + WatchAllServices func(request *WatchAllServicesRequest) (*WatchAllServicesResponse, error) + WatchService func(request *WatchServiceRequest) (*WatchServiceResponse, error) + type ErrCode int32 + const ErrCodeAPIInstanceNotFound + const ErrCodeAPIInvalidArgument + const ErrCodeAPIInvalidConfig + const ErrCodeAPITimeoutError + const ErrCodeCircuitBreakerError + const ErrCodeCmdbNotFound + const ErrCodeConnectError + const ErrCodeConsumerInitCalleeError + const ErrCodeCount + const ErrCodeDstMetaMismatch + const ErrCodeInstanceInfoError + const ErrCodeInternalError + const ErrCodeInvalidRequest + const ErrCodeInvalidResponse + const ErrCodeInvalidRule + const ErrCodeInvalidServerResponse + const ErrCodeInvalidStateError + const ErrCodeLocationMismatch + const ErrCodeLocationNotFound + const ErrCodeMeshConfigNotFound + const ErrCodeNetworkError + const ErrCodePluginError + const ErrCodeRequestLimit + const ErrCodeRouteRuleNotMatch + const ErrCodeServerError + const ErrCodeServerException + const ErrCodeServerUserError + const ErrCodeServiceNotFound + const ErrCodeSuccess + const ErrCodeUnauthorized + const ErrCodeUnknown + const ErrCodeUnknownServerError + const ErrorCodeRpcError + const ErrorCodeRpcTimeout + func ErrCodeFromIndex(i int) ErrCode + func GetErrorCodeFromError(e error) ErrCode + func (e ErrCode) Retryable() bool + type ErrCodeType int + const PolarisError + const UserError + func GetErrCodeType(e ErrCode) ErrCodeType + type EventType uint32 + const EventInstances + const EventRateLimiting + const EventRouting + const EventServices + const EventUnknown + func ToEventType(value string) EventType + func (e EventType) String() string + type ExtendedSelector interface + ID func() int32 + Select func(criteria interface{}) (int, *ReplicateNodes, error) + type FailOverDefaultMetaConfig struct + Meta map[string]string + Type FailOverHandler + type FailOverHandler int + const CustomMeta + const GetOneHealth + const NotContainMetaKey + type FilteredInstanceCounter struct + func (f *FilteredInstanceCounter) AddIsolatedInstances(n int32) + func (f *FilteredInstanceCounter) AddRouteFilteredInstances(routerName string, n int32) + func (f *FilteredInstanceCounter) AddUnhealthyInstances(n int32) + func (f *FilteredInstanceCounter) GetIsolatedInstances() int32 + func (f *FilteredInstanceCounter) GetUnhealthyInstances() int32 + type GetAllInstancesRequest struct + FlowID uint64 + Namespace string + RetryCount *int + Service string + Timeout *time.Duration + func (g *GetAllInstancesRequest) GetMetadata() map[string]string + func (g *GetAllInstancesRequest) GetNamespace() string + func (g *GetAllInstancesRequest) GetResponse() *InstancesResponse + func (g *GetAllInstancesRequest) GetRetryCountPtr() *int + func (g *GetAllInstancesRequest) GetService() string + func (g *GetAllInstancesRequest) GetTimeoutPtr() *time.Duration + func (g *GetAllInstancesRequest) SetRetryCount(retryCount int) + func (g *GetAllInstancesRequest) SetTimeout(duration time.Duration) + func (g *GetAllInstancesRequest) Validate() error + type GetInstancesRequest struct + Arguments []Argument + Canary string + FlowID uint64 + IncludeCircuitBreakInstances bool + IncludeUnhealthyInstances bool + Metadata map[string]string + Namespace string + RetryCount *int + Service string + SkipRouteFilter bool + SourceService *ServiceInfo + Timeout *time.Duration + func (g *GetInstancesRequest) AddArguments(argumet ...Argument) + func (g *GetInstancesRequest) GetCanary() string + func (g *GetInstancesRequest) GetMetadata() map[string]string + func (g *GetInstancesRequest) GetNamespace() string + func (g *GetInstancesRequest) GetResponse() *InstancesResponse + func (g *GetInstancesRequest) GetRetryCountPtr() *int + func (g *GetInstancesRequest) GetService() string + func (g *GetInstancesRequest) GetTimeoutPtr() *time.Duration + func (g *GetInstancesRequest) SetCanary(canary string) + func (g *GetInstancesRequest) SetRetryCount(retryCount int) + func (g *GetInstancesRequest) SetTimeout(duration time.Duration) + func (g *GetInstancesRequest) Validate() error + type GetOneInstanceRequest struct + Arguments []Argument + Canary string + EnableFailOverDefaultMeta bool + FailOverDefaultMeta FailOverDefaultMetaConfig + FlowID uint64 + HashKey []byte + HashValue uint64 + LbPolicy string + Metadata map[string]string + Namespace string + ReplicateCount int + RetryCount *int + Service string + SourceService *ServiceInfo + Timeout *time.Duration + func (g *GetOneInstanceRequest) AddArguments(argumet ...Argument) + func (g *GetOneInstanceRequest) GetCanary() string + func (g *GetOneInstanceRequest) GetMetadata() map[string]string + func (g *GetOneInstanceRequest) GetNamespace() string + func (g *GetOneInstanceRequest) GetResponse() *InstancesResponse + func (g *GetOneInstanceRequest) GetRetryCountPtr() *int + func (g *GetOneInstanceRequest) GetService() string + func (g *GetOneInstanceRequest) GetTimeoutPtr() *time.Duration + func (g *GetOneInstanceRequest) SetCanary(canary string) + func (g *GetOneInstanceRequest) SetRetryCount(retryCount int) + func (g *GetOneInstanceRequest) SetTimeout(duration time.Duration) + func (g *GetOneInstanceRequest) Validate() error + type GetServiceRuleRequest struct + FlowID uint64 + Namespace string + RetryCount *int + Service string + Timeout *time.Duration + func (g *GetServiceRuleRequest) GetMetadata() map[string]string + func (g *GetServiceRuleRequest) GetNamespace() string + func (g *GetServiceRuleRequest) GetResponse() *ServiceRuleResponse + func (g *GetServiceRuleRequest) GetRetryCountPtr() *int + func (g *GetServiceRuleRequest) GetService() string + func (g *GetServiceRuleRequest) GetTimeoutPtr() *time.Duration + func (g *GetServiceRuleRequest) SetRetryCount(retryCount int) + func (g *GetServiceRuleRequest) SetTimeout(duration time.Duration) + func (g *GetServiceRuleRequest) Validate() error + type GetServicesRequest struct + Business string + FlowID uint64 + Metadata map[string]string + Namespace string + RetryCount *int + Timeout *time.Duration + func (g *GetServicesRequest) GetRetryCountPtr() *int + func (g *GetServicesRequest) GetTimeoutPtr() *time.Duration + func (g *GetServicesRequest) SetRetryCount(retryCount int) + func (g *GetServicesRequest) SetTimeout(duration time.Duration) + func (g *GetServicesRequest) Validate() error + type HashSet map[interface{}]bool + func (h HashSet) Add(value interface{}) + func (h HashSet) Contains(value interface{}) bool + func (h HashSet) Copy() HashSet + func (h HashSet) Delete(value interface{}) bool + type HealthCheckStatus int + const Dead + const Healthy + type InitCalleeServiceRequest struct + Namespace string + Service string + Timeout *time.Duration + func (g *InitCalleeServiceRequest) Validate() error + type Instance interface + DeepClone func() Instance + GetCampus func() string + GetCircuitBreakerStatus func() CircuitBreakerStatus + GetHost func() string + GetIDC func() string + GetId func() string + GetInstanceKey func() InstanceKey + GetLogicSet func() string + GetMetadata func() map[string]string + GetNamespace func() string + GetPort func() uint32 + GetPriority func() uint32 + GetProtocol func() string + GetRegion func() string + GetRevision func() string + GetService func() string + GetTtl func() int64 + GetVersion func() string + GetVpcId func() string + GetWeight func() int + GetZone func() string + IsEnableHealthCheck func() bool + IsHealthy func() bool + IsIsolated func() bool + SetHealthy func(status bool) + type InstanceAddEvent struct + Instances []Instance + type InstanceDeRegisterRequest struct + Host string + InstanceID string + Namespace string + Port int + RetryCount *int + Service string + ServiceToken string + Timeout *time.Duration + func (g *InstanceDeRegisterRequest) GetRetryCountPtr() *int + func (g *InstanceDeRegisterRequest) GetTimeoutPtr() *time.Duration + func (g *InstanceDeRegisterRequest) SetRetryCount(retryCount int) + func (g *InstanceDeRegisterRequest) SetTimeout(duration time.Duration) + func (g *InstanceDeRegisterRequest) Validate() error + func (g InstanceDeRegisterRequest) String() string + type InstanceDeleteEvent struct + Instances []Instance + type InstanceEvent struct + AddEvent *InstanceAddEvent + DeleteEvent *InstanceDeleteEvent + UpdateEvent *InstanceUpdateEvent + func (e *InstanceEvent) GetSubScribeEventType() SubScribeEventType + type InstanceGauge interface + GetAPI func() ApiOperation + GetCalledInstance func() Instance + GetCircuitBreakerStatus func() CircuitBreakerStatus + GetDelay func() *time.Duration + GetDelayRange func() ApiDelayRange + GetHost func() string + GetNamespace func() string + GetPort func() int + GetRetCodeValue func() int32 + GetRetStatus func() RetStatus + GetService func() string + Validate func() error + type InstanceHeartbeatRequest struct + Host string + InstanceID string + Namespace string + Port int + RetryCount *int + Service string + ServiceToken string + Timeout *time.Duration + func (g *InstanceHeartbeatRequest) GetRetryCountPtr() *int + func (g *InstanceHeartbeatRequest) GetTimeoutPtr() *time.Duration + func (g *InstanceHeartbeatRequest) SetRetryCount(retryCount int) + func (g *InstanceHeartbeatRequest) SetTimeout(duration time.Duration) + func (g *InstanceHeartbeatRequest) Validate() error + func (g InstanceHeartbeatRequest) String() string + type InstanceKey struct + Host string + Port int + func (i InstanceKey) String() string + type InstanceRegisterRequest struct + Healthy *bool + Host string + InstanceId string + Isolate *bool + Location *Location + Metadata map[string]string + Namespace string + Port int + Priority *int + Protocol *string + RetryCount *int + Service string + ServiceToken string + TTL *int + Timeout *time.Duration + Version *string + Weight *int + func (g *InstanceRegisterRequest) GetLocation() *Location + func (g *InstanceRegisterRequest) GetRetryCountPtr() *int + func (g *InstanceRegisterRequest) GetTimeoutPtr() *time.Duration + func (g *InstanceRegisterRequest) SetDefaultTTL() + func (g *InstanceRegisterRequest) SetHealthy(healthy bool) + func (g *InstanceRegisterRequest) SetIsolate(isolate bool) + func (g *InstanceRegisterRequest) SetLocation(loc *Location) + func (g *InstanceRegisterRequest) SetRetryCount(retryCount int) + func (g *InstanceRegisterRequest) SetTTL(ttl int) + func (g *InstanceRegisterRequest) SetTimeout(duration time.Duration) + func (g *InstanceRegisterRequest) Validate() error + func (g InstanceRegisterRequest) String() string + type InstanceRegisterResponse struct + Existed bool + InstanceID string + type InstanceSet struct + func (i *InstanceSet) Count() int + func (i *InstanceSet) GetInstances() WeightIndexSlice + func (i *InstanceSet) GetLock() sync.Locker + func (i *InstanceSet) GetRealInstances() []Instance + func (i *InstanceSet) GetSelector(id int32) ExtendedSelector + func (i *InstanceSet) GetServiceClusters() ServiceClusters + func (i *InstanceSet) GetValue(index int) uint64 + func (i *InstanceSet) MaxWeight() int + func (i *InstanceSet) SetSelector(selector ExtendedSelector) + func (i *InstanceSet) String() string + func (i *InstanceSet) TotalWeight() int + type InstanceUpdateEvent struct + UpdateList []OneInstanceUpdate + type InstanceWeight struct + DynamicWeight uint32 + InstanceID string + type InstancesListener interface + OnInstancesUpdate func(*InstancesResponse) + type InstancesResponse struct + Cluster *Cluster + FlowID uint64 + HashValue uint64 + Instances []Instance + NotExists bool + Revision string + TotalWeight int + func (i *InstancesResponse) GetCluster() *Cluster + func (i *InstancesResponse) GetHashValue() uint64 + func (i *InstancesResponse) GetInstance(instanceID string) Instance + func (i *InstancesResponse) GetInstances() []Instance + func (i *InstancesResponse) GetRevision() string + func (i *InstancesResponse) GetServiceClusters() ServiceClusters + func (i *InstancesResponse) GetTotalWeight() int + func (i *InstancesResponse) GetType() EventType + func (i *InstancesResponse) IsCacheLoaded() bool + func (i *InstancesResponse) IsInitialized() bool + func (i *InstancesResponse) IsNotExists() bool + func (i *InstancesResponse) ReloadServiceClusters() + type Location struct + Campus string + Region string + Zone string + func (l *Location) IsEmpty() bool + func (l Location) String() string + type LocationBasedMetaKey struct + type LocationInfo interface + GetLastError func() SDKError + GetLocation func() *Location + GetStatus func() uint32 + IsLocationInitialized func() bool + IsLocationReady func() bool + type MeshKey struct + Business string + TypeUrl string + func (s MeshKey) String() string + type MetaComposedValue struct + type MetricType int + const CircuitBreakStat + const InstanceStat + const LoadBalanceStat + const PluginAPIStat + const RateLimitStat + const RouteStat + const SDKAPIStat + const SDKCfgStat + const ServiceStat + type NotifyTrigger struct + EnableDstInstances bool + EnableDstRateLimit bool + EnableDstRoute bool + EnableServices bool + EnableSrcRoute bool + func (n *NotifyTrigger) Clear() + type OnConfigFileChange func(event ConfigFileChangeEvent) + type OneInstanceResponse struct + func (o *OneInstanceResponse) GetInstance() Instance + type OneInstanceUpdate struct + After Instance + Before Instance + type PeriodicCallBack interface + OnTaskEvent func(event TaskEvent) + Process func(taskKey interface{}, taskValue interface{}, lastProcessTime time.Time) TaskResult + type PeriodicTask struct + CallBack PeriodicCallBack + DelayStart bool + LongRun bool + Name string + Period time.Duration + TakePriority bool + type PriorityCallBack interface + Process func() + type PriorityTask struct + CallBack PriorityCallBack + Name string + type ProcessLoadBalanceRequest struct + DstInstances ServiceInstances + HashKey []byte + LbPolicy string + ReplicateCount int + func (p *ProcessLoadBalanceRequest) GetResponse() *InstancesResponse + func (p *ProcessLoadBalanceRequest) Validate() error + type ProcessRoutersRequest struct + Arguments []Argument + DstInstances ServiceInstances + Method string + RetryCount *int + Routers []string + SourceService ServiceInfo + Timeout *time.Duration + func (p *ProcessRoutersRequest) AddArguments(arg ...Argument) + func (p *ProcessRoutersRequest) GetResponse() *InstancesResponse + func (p *ProcessRoutersRequest) GetRetryCountPtr() *int + func (p *ProcessRoutersRequest) GetTimeoutPtr() *time.Duration + func (p *ProcessRoutersRequest) SetRetryCount(v int) + func (p *ProcessRoutersRequest) SetTimeout(duration time.Duration) + func (p *ProcessRoutersRequest) Validate() error + type QuotaFutureImpl struct + func QuotaFutureWithResponse(resp *QuotaResponse) *QuotaFutureImpl + func (q *QuotaFutureImpl) Done() <-chan struct{} + func (q *QuotaFutureImpl) Get() *QuotaResponse + func (q *QuotaFutureImpl) GetImmediately() *QuotaResponse + func (q *QuotaFutureImpl) Release() + type QuotaRequestImpl struct + RetryCount *int + Timeout *time.Duration + Token uint32 + func (q *QuotaRequestImpl) AddArgument(argument Argument) + func (q *QuotaRequestImpl) Arguments() []Argument + func (q *QuotaRequestImpl) GetLabels() map[string]string + func (q *QuotaRequestImpl) GetMethod() string + func (q *QuotaRequestImpl) GetNamespace() string + func (q *QuotaRequestImpl) GetRetryCountPtr() *int + func (q *QuotaRequestImpl) GetService() string + func (q *QuotaRequestImpl) GetTimeoutPtr() *time.Duration + func (q *QuotaRequestImpl) GetToken() uint32 + func (q *QuotaRequestImpl) SetLabels(labels map[string]string) + func (q *QuotaRequestImpl) SetMethod(method string) + func (q *QuotaRequestImpl) SetNamespace(namespace string) + func (q *QuotaRequestImpl) SetRetryCount(retryCount int) + func (q *QuotaRequestImpl) SetService(svc string) + func (q *QuotaRequestImpl) SetTimeout(timeout time.Duration) + func (q *QuotaRequestImpl) SetToken(token uint32) + func (q *QuotaRequestImpl) Validate() error + type QuotaResponse struct + Code QuotaResultCode + Info string + WaitMs int64 + type QuotaResultCode int + const QuotaResultLimited + const QuotaResultOk + type RateLimitGauge struct + Arguments []Argument + Method string + Namespace string + Result QuotaResultCode + RuleName string + Service string + type RegistryValue interface + GetHashValue func() uint64 + GetRevision func() string + GetType func() EventType + IsInitialized func() bool + IsNotExists func() bool + type ReplicateNodes struct + Count int + Indexes []int + Instances atomic.Value + SvcClusters ServiceClusters + func (r *ReplicateNodes) GetInstances() []Instance + type ReportClientRequest struct + Host string + ID string + Location *Location + PersistHandler func(message proto.Message) error + StatInfos []StatInfo + Timeout time.Duration + Type string + Version string + func (r *ReportClientRequest) Validate() error + type ReportClientResponse struct + Campus string + Mode RunMode + Region string + Version string + Zone string + type RetStatus string + const RetFail + const RetFlowControl + const RetReject + const RetSuccess + const RetTimeout + const RetUnknown + type RuleCache interface + GetMessageCache func(message proto.Message) interface{} + GetRegexMatcher func(message string) (*regexp.Regexp, error) + SetMessageCache func(message proto.Message, cacheValue interface{}) + func NewRuleCache() RuleCache + type RunMode int + type SDKError interface + Error func() string + ErrorCode func() ErrCode + ServerCode func() uint32 + ServerInfo func() string + func NewSDKError(errCode ErrCode, cause error, msg string, args ...interface{}) SDKError + func NewSDKErrorWithServerInfo(errCode ErrCode, cause error, serverCode uint32, serverInfo string, msg string, ...) SDKError + func NewServerSDKError(serverCode uint32, serverInfo string, cause error, msg string, ...) SDKError + type SDKToken struct + Client string + HostName string + IP string + PID int32 + PodName string + UID string + Version string + type SelectorBase struct + Id int32 + func (s *SelectorBase) ID() int32 + type ServiceCallResult struct + CalledIP string + CalledInstance Instance + Delay *time.Duration + Method string + RetCode *int32 + RetStatus RetStatus + RuleName string + SourceService *ServiceInfo + func (s *ServiceCallResult) GetCalledInstance() Instance + func (s *ServiceCallResult) GetCallerNamespace() string + func (s *ServiceCallResult) GetCallerService() string + func (s *ServiceCallResult) GetDelay() *time.Duration + func (s *ServiceCallResult) GetHost() string + func (s *ServiceCallResult) GetID() string + func (s *ServiceCallResult) GetMethod() string + func (s *ServiceCallResult) GetNamespace() string + func (s *ServiceCallResult) GetPort() int + func (s *ServiceCallResult) GetRetCode() *int32 + func (s *ServiceCallResult) GetRetCodeValue() int32 + func (s *ServiceCallResult) GetRetStatus() RetStatus + func (s *ServiceCallResult) GetService() string + func (s *ServiceCallResult) SetCalledInstance(inst Instance) *ServiceCallResult + func (s *ServiceCallResult) SetDelay(duration time.Duration) *ServiceCallResult + func (s *ServiceCallResult) SetMethod(method string) + func (s *ServiceCallResult) SetRetCode(value int32) *ServiceCallResult + func (s *ServiceCallResult) SetRetStatus(retStatus RetStatus) *ServiceCallResult + func (s *ServiceCallResult) Validate() error + type ServiceClusters interface + AddInstance func(instance Instance) + GetClusterInstances func(cacheKey ClusterKey) *ClusterValue + GetContainMetaKeyClusterInstances func(cacheKey ClusterKey) *ClusterValue + GetContainNotMatchMetaKeyClusterInstances func(cacheKey ClusterKey) *ClusterValue + GetExtendedCacheValue func(pluginIndex int) interface{} + GetInstanceMetaValues func(location Location, metaKey string) map[string]string + GetNearbyCluster func(location Location) (*Cluster, int) + GetNotContainMetaKeyClusterInstances func(cacheKey ClusterKey) *ClusterValue + GetServiceInstances func() ServiceInstances + GetServiceKey func() ServiceKey + HasCampus func(campus string) bool + HasRegion func(region string) bool + HasZone func(zone string) bool + IsCanaryEnabled func() bool + IsNearbyEnabled func() bool + SetExtendedCacheValue func(pluginIndex int, value interface{}) + SetNearbyCluster func(location Location, cluster *Cluster, matchLevel int) + func NewServiceClusters(svcInstances ServiceInstances) ServiceClusters + type ServiceEventKey struct + Type EventType + func (s ServiceEventKey) String() string + type ServiceInfo struct + Instance string + Metadata map[string]string + Namespace string + Service string + func (i *ServiceInfo) AddArgument(arg Argument) + func (i *ServiceInfo) GetMetadata() map[string]string + func (i *ServiceInfo) GetNamespace() string + func (i *ServiceInfo) GetService() string + func (i *ServiceInfo) HasService() bool + func (i *ServiceInfo) IsEmpty() bool + func (i ServiceInfo) String() string + type ServiceInstances interface + GetInstance func(string) Instance + GetInstances func() []Instance + GetServiceClusters func() ServiceClusters + GetTotalWeight func() int + IsCacheLoaded func() bool + ReloadServiceClusters func() + func NewDefaultServiceInstances(service ServiceInfo, instances []Instance) ServiceInstances + func NewDefaultServiceInstancesWithRegistryValue(service ServiceInfo, registryValue RegistryValue, instances []Instance) ServiceInstances + type ServiceKey struct + Namespace string + Service string + func (s ServiceKey) String() string + type ServiceMetadata interface + GetMetadata func() map[string]string + GetNamespace func() string + GetService func() string + type ServiceRule interface + GetNamespace func() string + GetRuleCache func() RuleCache + GetService func() string + GetValidateError func() error + GetValue func() interface{} + IsCacheLoaded func() bool + type ServiceRuleListener interface + OnServiceRuleUpdate func(*ServiceRuleResponse) + type ServiceRuleResponse struct + HashValue uint64 + NotExists bool + Revision string + RuleCache RuleCache + Service ServiceKey + Type EventType + ValidateError error + Value interface{} + func (s *ServiceRuleResponse) GetHashValue() uint64 + func (s *ServiceRuleResponse) GetNamespace() string + func (s *ServiceRuleResponse) GetRevision() string + func (s *ServiceRuleResponse) GetRuleCache() RuleCache + func (s *ServiceRuleResponse) GetService() string + func (s *ServiceRuleResponse) GetType() EventType + func (s *ServiceRuleResponse) GetValidateError() error + func (s *ServiceRuleResponse) GetValue() interface{} + func (s *ServiceRuleResponse) IsCacheLoaded() bool + func (s *ServiceRuleResponse) IsInitialized() bool + func (s *ServiceRuleResponse) IsNotExists() bool + type Services interface + GetNamespace func() string + GetValue func() []*ServiceKey + type ServicesListener interface + OnServicesUpdate func(*ServicesResponse) + type ServicesResponse struct + HashValue uint64 + Revision string + Type EventType + ValidateError error + Value []*ServiceKey + func (s *ServicesResponse) GetHashValue() uint64 + func (s *ServicesResponse) GetRevision() string + func (s *ServicesResponse) GetType() EventType + func (s *ServicesResponse) GetValidateError() error + func (s *ServicesResponse) GetValue() []*ServiceKey + func (s *ServicesResponse) IsInitialized() bool + func (s *ServicesResponse) IsNotExists() bool + type StatInfo struct + Path string + Port uint32 + Protocol string + Target string + func (s StatInfo) Empty() bool + type Status int + const Close + const HalfOpen + const Open + func (s Status) String() string + type SubScribeEvent interface + GetSubScribeEventType func() SubScribeEventType + type SubScribeEventType int + const EventInstance + type SyncHashSet struct + func NewSyncHashSet() *SyncHashSet + func (s *SyncHashSet) Add(value interface{}) + func (s *SyncHashSet) Contains(value interface{}) bool + func (s *SyncHashSet) Copy() HashSet + func (s *SyncHashSet) Delete(value interface{}) bool + type TaskEvent int + const EventStart + const EventStop + type TaskResult int + const CONTINUE + const SKIP + const TERMINATE + type TaskValue interface + CompareTo func(interface{}) int + EnsureDeleted func(value interface{}) bool + type TaskValues interface + AddValue func(key interface{}, value TaskValue) + DeleteValue func(key interface{}, value TaskValue) + Started func() bool + type ValueContext interface + GetClientId func() string + GetCurrentLocation func() LocationInfo + GetEngine func() Engine + GetValue func(key string) (interface{}, bool) + Now func() time.Time + SetCurrentLocation func(*Location, SDKError) bool + SetValue func(key string, value interface{}) + Since func(time.Time) time.Duration + WaitLocationInfo func(ctx context.Context, locationStatus uint32) bool + func NewValueContext() ValueContext + type WatchAllInstancesRequest struct + InstancesListener InstancesListener + WaitIndex uint64 + WaitTime time.Duration + WatchMode WatchMode + func (req *WatchAllInstancesRequest) Validate() error + type WatchAllInstancesResponse struct + func NewWatchAllInstancesResponse(watchId uint64, response *InstancesResponse, cancelWatch func(uint642 uint64)) *WatchAllInstancesResponse + func (w *WatchAllInstancesResponse) CancelWatch() + func (w *WatchAllInstancesResponse) InstancesResponse() *InstancesResponse + func (w *WatchAllInstancesResponse) WatchId() uint64 + type WatchAllServicesRequest struct + Namespace string + ServicesListener ServicesListener + WaitIndex uint64 + WaitTime time.Duration + WatchMode WatchMode + func (req *WatchAllServicesRequest) Validate() error + type WatchAllServicesResponse struct + func NewWatchAllServicesResponse(watchId uint64, response *ServicesResponse, cancelWatch func(uint642 uint64)) *WatchAllServicesResponse + func (w *WatchAllServicesResponse) CancelWatch() + func (w *WatchAllServicesResponse) ServicesResponse() *ServicesResponse + func (w *WatchAllServicesResponse) WatchId() uint64 + type WatchMode int + const WatchModeLongPull + const WatchModeNotify + type WatchRequest struct + InstancesListener []InstancesListener + ServiceRuleListener []ServiceRuleListener + WaitIndex uint64 + WaitTime time.Duration + WatchMode WatchMode + func (req *WatchRequest) Validate() error + type WatchResponse struct + InstancesResponse *InstancesResponse + ServiceRuleResponse *ServiceRuleResponse + type WatchServiceRequest struct + Key ServiceKey + func (req *WatchServiceRequest) Validate() error + type WatchServiceResponse struct + EventChannel <-chan SubScribeEvent + GetAllInstancesResp *InstancesResponse + type WeightIndexSlice []WeightedIndex + type WeightedIndex struct + AccumulateWeight int + Index int