Documentation ¶
Overview ¶
@Time : 2019-10-08 16:28 @Author : zr
@Time : 2019-10-08 11:06 @Author : zr
@Time : 2019-10-14 10:16 @Author : zr
@Time : 2019-10-08 16:18 @Author : zr
Index ¶
- Variables
- func GRpcConnTest() pool.ConnTestFunc
- func GetCurrentPath() (string, error)
- type ConnFactory
- type Consumer
- type ConsumerOption
- type ConsumerOptionConnFactory
- type ConsumerOptionConnMax
- type ConsumerOptionConnMin
- type ConsumerOptionConnTestFunc
- type Logger
- type Manager
- func (m *Manager) Close() error
- func (m *Manager) NewConsumer(service *Service, options ...ConsumerOption) (c *Consumer, err error)
- func (m *Manager) NewProducer(service *Service, port int, options ...ProducerOption) (producer *Producer, err error)
- func (m *Manager) NewService(sPath string, options ...ServiceOption) *Service
- func (m *Manager) RunSync() (err error)
- func (m *Manager) SetLogger(logger Logger)
- type NodeInfo
- type NodeRunningError
- type OptionHost
- type Producer
- type ProducerOption
- type Protocol
- type Service
- type ServiceOption
- type ServiceOptionProtocol
- type ServiceOptionServiceType
- type ServiceType
- type Status
- type ZKError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoService = errors.New("no service") ErrNoServiceAlive = errors.New("no service alive") ErrHost = errors.New("host error") ErrConnectToZooKeeper = zk.ErrNoServer ErrInvalidPath = zk.ErrInvalidPath ErrSingletonServiceIsRunning = errors.New("service type is singleton and there is one already running") )
Functions ¶
func GRpcConnTest ¶ added in v1.1.0
func GRpcConnTest() pool.ConnTestFunc
func GetCurrentPath ¶ added in v1.1.1
Types ¶
type ConnFactory ¶ added in v1.1.0
func GRpcFactory ¶ added in v1.1.0
func GRpcFactory() ConnFactory
type Consumer ¶ added in v1.0.1
type Consumer struct {
// contains filtered or unexported fields
}
func (*Consumer) ReleaseConn ¶ added in v1.1.0
type ConsumerOption ¶ added in v1.1.0
type ConsumerOption interface {
// contains filtered or unexported methods
}
type ConsumerOptionConnFactory ¶ added in v1.1.0
type ConsumerOptionConnFactory ConnFactory
type ConsumerOptionConnMax ¶ added in v1.1.0
type ConsumerOptionConnMax int
type ConsumerOptionConnMin ¶ added in v1.1.0
type ConsumerOptionConnMin int
type ConsumerOptionConnTestFunc ¶ added in v1.1.0
type ConsumerOptionConnTestFunc pool.ConnTestFunc
type Logger ¶ added in v1.0.3
type Logger interface { Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Panic(args ...interface{}) }
type Manager ¶ added in v1.0.1
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶ added in v1.0.1
func (*Manager) NewConsumer ¶ added in v1.1.0
func (m *Manager) NewConsumer(service *Service, options ...ConsumerOption) (c *Consumer, err error)
func (*Manager) NewProducer ¶ added in v1.1.0
func (*Manager) NewService ¶ added in v1.1.0
func (m *Manager) NewService(sPath string, options ...ServiceOption) *Service
type NodeRunningError ¶ added in v1.1.0
func (*NodeRunningError) Error ¶ added in v1.1.0
func (e *NodeRunningError) Error() string
func (*NodeRunningError) Unwrap ¶ added in v1.1.0
func (e *NodeRunningError) Unwrap() error
type Producer ¶ added in v1.1.0
type Producer struct { //public: NodeInfo // contains filtered or unexported fields }
type ProducerOption ¶ added in v1.1.0
type ProducerOption interface {
// contains filtered or unexported methods
}
type Service ¶
type Service struct { Path string `json:"-"` Protocol Protocol Type ServiceType }
type ServiceOption ¶ added in v1.1.0
type ServiceOption interface {
// contains filtered or unexported methods
}
type ServiceOptionProtocol ¶ added in v1.1.0
type ServiceOptionProtocol Protocol
type ServiceOptionServiceType ¶ added in v1.1.0
type ServiceOptionServiceType ServiceType
type ServiceType ¶ added in v1.1.0
type ServiceType int
const ( ServiceTypeNormal ServiceType = iota ServiceTypeSingleton //只允许运行一个实例 )
func (ServiceType) String ¶ added in v1.1.0
func (s ServiceType) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.