Versions in this module Expand all Collapse all v0 v0.1.0 May 12, 2016 Changes in this version + const PackageName + var DNSServerFlag = config.DeclareString(PackageName, "dnsServer", "leverosconsul:8600") + var ErrServiceNotFound = fmt.Errorf("Service not found") + var GRPCUnusedTimeoutFlag = config.DeclareDuration(PackageName, "grpcUnusedTimeout", 5 * time.Minute) + func DereferenceService(service string) (target string, node string, err error) + func DeregisterService(instanceID string) error + func GetOwnNodeName() (string, error) + func InternalRPCConn(grpcPool *GRPCPool, service string) (conn *grpc.ClientConn, err error) + func InternalRPCConnResource(grpcPool *GRPCPool, service string, resource string, ttl time.Duration) (conn *grpc.ClientConn, sessionID string, err error) + func RegisterServiceLocal(service string, instanceID string, target string, ttl time.Duration) (err error) + func ResourceReleased(service string, resource string) (released chan error) + func ServiceKeepAlive(instanceID string) error + func WaitResource(service string, resource string) error + type GRPCPool struct + func NewGRPCPool() (*GRPCPool, error) + func (pool *GRPCPool) Dial(target string) (*grpc.ClientConn, error) + func (pool *GRPCPool) KeepAlive(target string) + type KeepAliveBuffer struct + ID string + func NewServiceKeepAliveBuffer(instanceID string, maxWait time.Duration) *KeepAliveBuffer + func NewSessionKeepAliveBuffer(sessionID string, maxWait time.Duration) *KeepAliveBuffer + func (kab *KeepAliveBuffer) Close() + func (kab *KeepAliveBuffer) KeepAlive() + type Resource struct + func ConstructResource(service string, resource string, timeout time.Duration) (res *Resource, success bool, err error) + func DereferenceOrRegisterResource(service string, resource string, ttl time.Duration) (res *Resource, isNew bool, err error) + func DereferenceResource(service string, resource string) (res *Resource, err error) + func DereferenceResourceConsistent(service string, resource string) (res *Resource, err error) + func ExistingResource(service string, resource string, sessionID string) (res *Resource) + func RegisterResource(service string, resource string, ttl time.Duration) (res *Resource, success bool, err error) + func RegisterResourceCustom(service string, resource string, target string, targetNode string, ...) (res *Resource, success bool, err error) + func RegisterResourceLocal(resource string, ttl time.Duration) (res *Resource, success bool, err error) + func (res *Resource) Deregister() error + func (res *Resource) DoneConstructing(target string, targetNode string, ttl time.Duration) (err error) + func (res *Resource) GetSessionID() string + func (res *Resource) GetTarget() string + func (res *Resource) GetTargetNode() string + func (res *Resource) KeepAlive() error + func (res *Resource) LoseLockCh() <-chan struct{} + func (res *Resource) LostLock() bool + type SelfKeepAlive struct + ID string + func NewServiceSelfKeepAlive(instanceID string, interval time.Duration) *SelfKeepAlive + func NewSessionSelfKeepAlive(sessionID string, interval time.Duration) *SelfKeepAlive + func (ska *SelfKeepAlive) Stop()