Versions in this module Expand all Collapse all v1 v1.0.0 Mar 17, 2017 Changes in this version + var DefaultConfig = &Config + var ErrDuplicateAdvertise = errors.New("service name already advertised") + var ErrNoInstance = errors.New("no thrift instances in disco") + var ErrNoInstanceOpen = errors.New("no thrift instances is open") + type ChangeWatch func() + type Config struct + Logger log.Logger + RandomSource io.Reader + type Disco struct + GUIDbytes [16]byte + func New(zkConnCreator ZkConnCreator, publishAddress string, config *Config) (*Disco, error) + func (d *Disco) Advertise(serviceName string, payload interface{}, port uint16) (err error) + func (d *Disco) Close() + func (d *Disco) CreatePersistentEphemeralNode(path string, payload []byte) (err error) + func (d *Disco) GUID() string + func (d *Disco) NinjaMode(ninjaMode bool) + func (d *Disco) Services(serviceName string) (*Service, error) + func (d *Disco) Var() expvar.Var + type Service struct + func (s *Service) ForceInstances(instances []ServiceInstance) + func (s *Service) ServiceInstances() []ServiceInstance + func (s *Service) String() string + func (s *Service) Watch(watch ChangeWatch) + type ServiceInstance struct + Address string + ID string + Name string + Payload interface{} + Port uint16 + RegistrationTimeUTC int64 + ServiceType string + SslPort *uint16 + URISpec *string + func (s *ServiceInstance) DialString() string + type ThriftTransport struct + Dialer net.Dialer + WrappedFactory thrift.TTransportFactory + func NewThriftTransport(service *Service, timeout time.Duration) *ThriftTransport + func NewThriftTransportWithMaxBufferSize(service *Service, timeout time.Duration, maxLength uint32) *ThriftTransport + func (d *ThriftTransport) Close() error + func (d *ThriftTransport) Flush() (err error) + func (d *ThriftTransport) IsOpen() bool + func (d *ThriftTransport) NextConnection() error + func (d *ThriftTransport) Open() error + func (d *ThriftTransport) Read(b []byte) (n int, err error) + func (d *ThriftTransport) RemainingBytes() uint64 + func (d *ThriftTransport) Write(b []byte) (n int, err error) + type ZkConn interface + ChildrenW func(path string) ([]string, *zk.Stat, <-chan zk.Event, error) + Close func() + Create func(path string, data []byte, flags int32, acl []zk.ACL) (string, error) + Delete func(path string, version int32) error + ExistsW func(path string) (bool, *zk.Stat, <-chan zk.Event, error) + GetW func(path string) ([]byte, *zk.Stat, <-chan zk.Event, error) + type ZkConnCreator interface + Connect func() (ZkConn, <-chan zk.Event, error) + func BuilderConnector(b *zkplus.Builder) ZkConnCreator + type ZkConnCreatorFunc func() (ZkConn, <-chan zk.Event, error) + func (z ZkConnCreatorFunc) Connect() (ZkConn, <-chan zk.Event, error)