Documentation
¶
Index ¶
- Variables
- func NewConnection(ctx context.Context) *connection
- func NewLease(ctx context.Context, appPrefix string, ownIp string, ...) *lease
- func NewPeers(ctx context.Context, client managementpb.ServiceClient, logger golog.Logger, ...) (*peers, error)
- type Service
- func (s *Service) IsPeer(address string) bool
- func (s *Service) Lock(tenant string, resource []string) error
- func (s *Service) OnPeerLeave(handler func(peerIp string))
- func (s *Service) PeerIps() []string
- func (s *Service) RLock(tenant string, resource []string) error
- func (s *Service) RUnlock(tenant string, resource []string)
- func (s *Service) Unlock(tenant string, resource []string)
- func (s *Service) WaitForStop()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWaitForClosedConnection = errors.New("cannot wait for closed connection") ErrWaitTooLong = errors.New("cannot reconnect to sync service") )
Functions ¶
func NewConnection ¶
func NewLease ¶
func NewLease( ctx context.Context, appPrefix string, ownIp string, client managementpb.ServiceClient, logger golog.Logger, ) *lease
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( ctx context.Context, client managementpb.ServiceClient, logger golog.Logger, appPrefix string, ownIp string, ) (*Service, error)
func (*Service) OnPeerLeave ¶
func (*Service) WaitForStop ¶
func (s *Service) WaitForStop()
Click to show internal directories.
Click to hide internal directories.