service

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

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) Cancel

func (s *Service) Cancel(c context.Context, arg *model.ArgCancel) (err error)

Cancel cancels the registration of an instance.

func (*Service) DelConns

func (s *Service) DelConns(arg *model.ArgPolls)

DelConns delete conn of host in appid

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) FetchAll

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

FetchAll fetch all instances of all the department.

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) Nodes

func (s *Service) Nodes(c context.Context) (nsi []*model.Node)

Nodes get all nodes of discovery.

func (*Service) Polling

func (s *Service) Polling(c context.Context, arg *model.ArgPolling) (res []string, err error)

Polling get polling clients.

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.

func (*Service) Renew

func (s *Service) 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 (*Service) Set

func (s *Service) Set(c context.Context, arg *model.ArgSet) (err error)

Set set the status of instance by hostnames.

Jump to

Keyboard shortcuts

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