Documentation ¶
Index ¶
- type Option
- func WithHealthy(healthy bool) Option
- func WithHeartbeat(heartbeat bool) Option
- func WithIsolate(isolate bool) Option
- func WithNamespace(namespace string) Option
- func WithProtocol(protocol string) Option
- func WithRetryCount(retryCount int) Option
- func WithServiceToken(serviceToken string) Option
- func WithTTL(TTL int) Option
- func WithTimeout(timeout time.Duration) Option
- func WithWeight(weight int) Option
- type Registry
- func (r *Registry) Deregister(_ context.Context, serviceInstance *registry.ServiceInstance) error
- func (r *Registry) GetService(_ context.Context, serviceName string) ([]*registry.ServiceInstance, error)
- func (r *Registry) Register(_ context.Context, serviceInstance *registry.ServiceInstance) error
- func (r *Registry) Watch(ctx context.Context, serviceName string) (registry.Watcher, error)
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *options)
Option is polaris option.
func WithHeartbeat ¶
WithHeartbeat . with Heartbeat option.
func WithNamespace ¶
WithNamespace with Namespace option.
func WithRetryCount ¶
WithRetryCount with RetryCount option.
func WithServiceToken ¶
WithServiceToken with ServiceToken option.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is polaris registry.
func NewRegistry ¶
func NewRegistry(provider api.ProviderAPI, consumer api.ConsumerAPI, opts ...Option) (r *Registry)
func NewRegistryWithConfig ¶
func NewRegistryWithConfig(conf config.Configuration, opts ...Option) (r *Registry)
func (*Registry) Deregister ¶
Deregister the registration.
func (*Registry) GetService ¶
func (r *Registry) GetService(_ context.Context, serviceName string) ([]*registry.ServiceInstance, error)
GetService return the service instances in memory according to the service name.
type Watcher ¶
type Watcher struct { ServiceName string Namespace string Ctx context.Context Cancel context.CancelFunc Channel <-chan model.SubScribeEvent ServiceInstances []*registry.ServiceInstance }
func (*Watcher) Next ¶
func (w *Watcher) Next() ([]*registry.ServiceInstance, error)
Next returns services in the following two cases: 1.the first time to watch and the service instance list is not empty. 2.any service instance changes found. if the above two conditions are not met, it will block until context deadline exceeded or canceled
Click to show internal directories.
Click to hide internal directories.