Documentation
¶
Index ¶
- type Service
- func (s *Service) Cancel(c context.Context, arg *model.ArgCancel) (err error)
- func (s *Service) DelConns(arg *model.ArgPolls)
- func (s *Service) Fetch(c context.Context, arg *model.ArgFetch) (info *model.InstanceInfo, err error)
- func (s *Service) FetchAll(c context.Context) (im map[string][]*model.Instance)
- func (s *Service) Fetchs(c context.Context, arg *model.ArgFetchs) (is map[string]*model.InstanceInfo, err error)
- func (s *Service) Nodes(c context.Context) (nsi []*model.Node)
- func (s *Service) Polling(c context.Context, arg *model.ArgPolling) (res []string, err error)
- func (s *Service) Polls(c context.Context, arg *model.ArgPolls) (ch chan map[string]*model.InstanceInfo, new bool, err error)
- func (s *Service) Register(c context.Context, ins *model.Instance, latestTimestamp int64, ...)
- func (s *Service) Renew(c context.Context, arg *model.ArgRenew) (i *model.Instance, err error)
- func (s *Service) Set(c context.Context, arg *model.ArgSet) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service discovery main service
func New ¶
func New(c *conf.Config) (s *Service, cancel context.CancelFunc)
New get a discovery service
func (*Service) Fetch ¶
func (s *Service) Fetch(c context.Context, arg *model.ArgFetch) (info *model.InstanceInfo, err error)
Fetch fetch all instances by appid.
func (*Service) Fetchs ¶
func (s *Service) Fetchs(c context.Context, arg *model.ArgFetchs) (is map[string]*model.InstanceInfo, err error)
Fetchs fetch multi app by appids.
func (*Service) Polls ¶
func (s *Service) 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 (*Service) Register ¶
func (s *Service) Register(c context.Context, ins *model.Instance, latestTimestamp int64, replication bool)
Register a new instance.
Click to show internal directories.
Click to hide internal directories.