discovery

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

type Discovery struct {
	// contains filtered or unexported fields
}

Discovery discovery.

func New

func New(c *conf.Config) (d *Discovery, cancel context.CancelFunc)

New get a discovery.

func (*Discovery) Cancel

func (d *Discovery) Cancel(c context.Context, arg *model.ArgCancel) (err error)

Cancel cancels the registration of an instance.

func (*Discovery) DelConns

func (d *Discovery) DelConns(arg *model.ArgPolls)

DelConns delete conn of host in appid

func (*Discovery) Fetch

func (d *Discovery) Fetch(c context.Context, arg *model.ArgFetch) (info *model.InstanceInfo, err error)

Fetch fetch all instances by appid.

func (*Discovery) FetchAll

func (d *Discovery) FetchAll(c context.Context) (im map[string][]*model.Instance)

FetchAll fetch all instances of all the department.

func (*Discovery) Fetchs

func (d *Discovery) Fetchs(c context.Context, arg *model.ArgFetchs) (is map[string]*model.InstanceInfo, err error)

Fetchs fetch multi app by appids.

func (*Discovery) Nodes

func (d *Discovery) Nodes(c context.Context) (nsi []*model.Node)

Nodes get all nodes of discovery.

func (*Discovery) Polls

func (d *Discovery) Polls(c context.Context, arg *model.ArgPolls) (ch chan map[string]*model.InstanceInfo, new bool, err error)

Polls hangs request and then write instances when that has changes, or return NotModified.

func (*Discovery) Register

func (d *Discovery) Register(c context.Context, ins *model.Instance, latestTimestamp int64, replication bool)

Register a new instance.

func (*Discovery) Renew

func (d *Discovery) Renew(c context.Context, arg *model.ArgRenew) (i *model.Instance, err error)

Renew marks the given instance of the given app name as renewed, and also marks whether it originated from replication.

func (*Discovery) Set

func (d *Discovery) Set(c context.Context, arg *model.ArgSet) (err error)

Set set metadata,color,status of instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL