Documentation ¶
Index ¶
- type API
- func (e *API) Deregister(ctx context.Context, endpoints []Endpoint) error
- func (e *API) GetService(ctx context.Context, serverName string) []Instance
- func (e *API) Register(ctx context.Context, serviceName string, endpoints ...Endpoint) error
- func (e *API) Subscribe(serverName string, fn func()) error
- func (e *API) ToAppID(serverName string) string
- func (e *API) Unsubscribe(serverName string)
- type APIInterface
- type Application
- type ApplicationsResponse
- type ApplicationsRootResponse
- type Client
- func (e *Client) Deregister(ctx context.Context, appID, instanceID string) error
- func (e *Client) Down(ctx context.Context, appID, instanceID string) error
- func (e *Client) FetchAllUpInstances(ctx context.Context) []Instance
- func (e *Client) FetchAppInstance(ctx context.Context, appID string, instanceID string) (m Instance, err error)
- func (e *Client) FetchAppInstances(ctx context.Context, appID string) (m Application, err error)
- func (e *Client) FetchAppUpInstances(ctx context.Context, appID string) []Instance
- func (e *Client) FetchApps(ctx context.Context) []Application
- func (e *Client) FetchInstance(ctx context.Context, instanceID string) (m Instance, err error)
- func (e *Client) Heartbeat(ep Endpoint)
- func (e *Client) Out(ctx context.Context, appID, instanceID string) error
- func (e *Client) Register(ctx context.Context, ep Endpoint) error
- type ClientOption
- type DataCenterInfo
- type Endpoint
- type Instance
- type Option
- type Port
- type Registry
- func (r *Registry) Deregister(ctx context.Context, service *registry.ServiceInstance) error
- func (r *Registry) Endpoints(service *registry.ServiceInstance) []Endpoint
- func (r *Registry) GetService(ctx context.Context, serviceName string) ([]*registry.ServiceInstance, error)
- func (r *Registry) Register(ctx context.Context, service *registry.ServiceInstance) error
- func (r *Registry) Watch(ctx context.Context, serviceName string) (registry.Watcher, error)
- type RequestInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) Deregister ¶
Deregister ctx is the same as register ctx
func (*API) GetService ¶
func (*API) Unsubscribe ¶
type APIInterface ¶
type APIInterface interface { Register(ctx context.Context, ep Endpoint) error Deregister(ctx context.Context, appID, instanceID string) error Heartbeat(ep Endpoint) FetchApps(ctx context.Context) []Application FetchAllUpInstances(ctx context.Context) []Instance FetchAppInstances(ctx context.Context, appID string) (m Application, err error) FetchAppUpInstances(ctx context.Context, appID string) []Instance FetchAppInstance(ctx context.Context, appID string, instanceID string) (m Instance, err error) FetchInstance(ctx context.Context, instanceID string) (m Instance, err error) Out(ctx context.Context, appID, instanceID string) error Down(ctx context.Context, appID, instanceID string) error }
type Application ¶
type ApplicationsResponse ¶
type ApplicationsResponse struct { Version string `json:"versions__delta"` AppsHashcode string `json:"apps__hashcode"` Applications []Application `json:"application"` }
type ApplicationsRootResponse ¶
type ApplicationsRootResponse struct {
ApplicationsResponse `json:"applications"`
}
ApplicationsRootResponse for /eureka/apps
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(urls []string, opts ...ClientOption) *Client
func (*Client) Deregister ¶
func (*Client) FetchAllUpInstances ¶
func (*Client) FetchAppInstance ¶
func (*Client) FetchAppInstances ¶
func (*Client) FetchAppUpInstances ¶
func (*Client) FetchInstance ¶
type ClientOption ¶
type ClientOption func(e *Client)
func WithClientContext ¶
func WithClientContext(ctx context.Context) ClientOption
func WithHeartbeatInterval ¶
func WithHeartbeatInterval(interval time.Duration) ClientOption
func WithMaxRetry ¶
func WithMaxRetry(maxRetry int) ClientOption
func WithNamespace ¶
func WithNamespace(path string) ClientOption
type DataCenterInfo ¶
type Instance ¶
type Instance struct { InstanceID string `json:"instanceId"` HostName string `json:"hostName"` Port Port `json:"port"` App string `json:"app"` IPAddr string `json:"ipAddr"` VipAddress string `json:"vipAddress"` Status string `json:"status"` SecurePort Port `json:"securePort"` HomePageURL string `json:"homePageUrl"` StatusPageURL string `json:"statusPageUrl"` HealthCheckURL string `json:"healthCheckUrl"` DataCenterInfo DataCenterInfo `json:"dataCenterInfo"` Metadata map[string]string `json:"metadata"` }
type Option ¶
type Option func(o *Registry)
func WithEurekaPath ¶
func WithHeartbeat ¶
func WithRefresh ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) Deregister ¶
Deregister registry service to zookeeper.
func (*Registry) Endpoints ¶
func (r *Registry) Endpoints(service *registry.ServiceInstance) []Endpoint
func (*Registry) GetService ¶
func (r *Registry) GetService(ctx context.Context, serviceName string) ([]*registry.ServiceInstance, error)
GetService get services from zookeeper
type RequestInstance ¶
type RequestInstance struct {
Instance Instance `json:"instance"`
}
Click to show internal directories.
Click to hide internal directories.