Documentation ¶
Index ¶
- Variables
- type Event
- type GJSONPath
- type Informer
- type IngressSpecFunc
- type IngressSpecsFunc
- type ServiceInstanceSpecsFunc
- type ServiceInstanceStatusFunc
- type ServiceInstanceStatusesFunc
- type ServiceSpecFunc
- type ServiceSpecsFunc
- type ServicesInstanceSpecFunc
- type TenantSpecFunc
- type TenantSpecsFunc
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAlreadyWatched is the error when watch the same entry again. ErrAlreadyWatched = fmt.Errorf("already watched") // ErrClosed is the error when watching a closed informer. ErrClosed = fmt.Errorf("informer already been closed") // ErrNotFound is the error when watching an entry which is not found. ErrNotFound = fmt.Errorf("not found") )
Functions ¶
This section is empty.
Types ¶
type GJSONPath ¶
type GJSONPath string
GJSONPath is the type of inform path, in GJSON syntax.
const ( // EventUpdate is the update inform event. EventUpdate = "Update" // EventDelete is the delete inform event. EventDelete = "Delete" // AllParts is the path of the whole structure. AllParts GJSONPath = "" // ServiceObservability is the path of service observability. ServiceObservability GJSONPath = "observability" // ServiceResilience is the path of service resilience. ServiceResilience GJSONPath = "resilience" // ServiceCanary is the path of service canary. ServiceCanary GJSONPath = "canary" // ServiceLoadBalance is the path of service loadbalance. ServiceLoadBalance GJSONPath = "loadBalance" // ServiceCircuitBreaker is the path of service resilience's circuitBreaker part. ServiceCircuitBreaker GJSONPath = "resilience.circuitBreaker" )
type Informer ¶
type Informer interface { OnPartOfServiceSpec(serviceName string, gjsonPath GJSONPath, fn ServiceSpecFunc) error OnAllServiceSpecs(fn ServiceSpecsFunc) error OnPartOfServiceInstanceSpec(serviceName, instanceID string, gjsonPath GJSONPath, fn ServicesInstanceSpecFunc) error OnServiceInstanceSpecs(serviceName string, fn ServiceInstanceSpecsFunc) error OnAllServiceInstanceSpecs(fn ServiceInstanceSpecsFunc) error OnPartOfServiceInstanceStatus(serviceName, instanceID string, gjsonPath GJSONPath, fn ServiceInstanceStatusFunc) error OnServiceInstanceStatuses(serviceName string, fn ServiceInstanceStatusesFunc) error OnAllServiceInstanceStatuses(fn ServiceInstanceStatusesFunc) error OnPartOfTenantSpec(tenantName string, gjsonPath GJSONPath, fn TenantSpecFunc) error OnAllTenantSpecs(fn TenantSpecsFunc) error OnPartOfIngressSpec(serviceName string, gjsonPath GJSONPath, fn IngressSpecFunc) error OnAllIngressSpecs(fn IngressSpecsFunc) error StopWatchServiceSpec(serviceName string, gjsonPath GJSONPath) StopWatchServiceInstanceSpec(serviceName string) Close() }
Informer is the interface for informing two type of storage changed for every Mesh spec structure.
- Based on comparison between old and new part of entry.
- Based on comparison on entries with the same prefix.
func NewInformer ¶
NewInformer creates an informer If service is specified, will only inform resource changes within the same tenant of the service and the global tenant, note this only apply to service, service instance and service status. if service is empty, will inform all resource changes.
type IngressSpecFunc ¶
IngressSpecFunc is the callback function type for service spec.
type IngressSpecsFunc ¶
IngressSpecsFunc is the callback function type for service specs.
type ServiceInstanceSpecsFunc ¶
type ServiceInstanceSpecsFunc func(value map[string]*spec.ServiceInstanceSpec) bool
ServiceInstanceSpecsFunc is the callback function type for service instance specs.
type ServiceInstanceStatusFunc ¶
type ServiceInstanceStatusFunc func(event Event, value *spec.ServiceInstanceStatus) bool
ServiceInstanceStatusFunc is the callback function type for service instance status.
type ServiceInstanceStatusesFunc ¶
type ServiceInstanceStatusesFunc func(value map[string]*spec.ServiceInstanceStatus) bool
ServiceInstanceStatusesFunc is the callback function type for service instance statuses.
type ServiceSpecFunc ¶
ServiceSpecFunc is the callback function type for service spec.
type ServiceSpecsFunc ¶
ServiceSpecsFunc is the callback function type for service specs.
type ServicesInstanceSpecFunc ¶
type ServicesInstanceSpecFunc func(event Event, instanceSpec *spec.ServiceInstanceSpec) bool
ServicesInstanceSpecFunc is the callback function type for service instance spec.
type TenantSpecFunc ¶
TenantSpecFunc is the callback function type for tenant spec.