Documentation ¶
Index ¶
- type AvailabilityListener
- type Client
- type ClusterMessage
- type ClusterMessageHandler
- type ClusterMessageType
- type ClusterRequest
- type ClusterResponse
- type FakeServer
- func (f *FakeServer) AvailabilityListener() AvailabilityListener
- func (f *FakeServer) BroadcastOneway(notif ClusterMessage) error
- func (f *FakeServer) BroadcastSync(notif ClusterMessage) error
- func (f *FakeServer) ConnectionCount() int
- func (f *FakeServer) RegisterMessageHandler(notificationType ClusterMessageType, listener ClusterMessageHandler)
- func (f *FakeServer) SendRequest(notif ClusterMessage, timeout time.Duration) (ClusterMessage, error)
- func (f *FakeServer) Start() error
- func (f *FakeServer) Stop() error
- type HealthChecker
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvailabilityListener ¶
type AvailabilityListener interface {
AvailabilityChanged(serverAddresses []string)
}
type Client ¶
type Client interface { SendRequest(message ClusterMessage, timeout time.Duration) (ClusterMessage, error) BroadcastOneway(notif ClusterMessage) error BroadcastSync(notif ClusterMessage) error Start() error Stop() error AvailabilityListener() AvailabilityListener }
type ClusterMessage ¶
ClusterMessage protos live in protos/squareup/cash/pranadb/notifications.proto
func DeserializeClusterMessage ¶
func DeserializeClusterMessage(data []byte) (ClusterMessage, error)
type ClusterMessageHandler ¶
type ClusterMessageHandler interface {
HandleMessage(notification ClusterMessage) (ClusterMessage, error)
}
type ClusterMessageType ¶
type ClusterMessageType int32
const ( ClusterMessageTypeUnknown ClusterMessageType = iota + 1 ClusterMessageDDLStatement ClusterMessageReloadProtobuf ClusterMessageClusterProposeRequest ClusterMessageClusterReadRequest ClusterMessageClusterProposeResponse ClusterMessageClusterReadResponse ClusterMessageNotificationTestMessage )
func TypeForClusterMessage ¶
func TypeForClusterMessage(notification ClusterMessage) ClusterMessageType
type ClusterRequest ¶
type ClusterRequest struct {
// contains filtered or unexported fields
}
type ClusterResponse ¶
type ClusterResponse struct {
// contains filtered or unexported fields
}
type FakeServer ¶
type FakeServer struct {
// contains filtered or unexported fields
}
func NewFakeServer ¶
func NewFakeServer() *FakeServer
func (*FakeServer) AvailabilityListener ¶
func (f *FakeServer) AvailabilityListener() AvailabilityListener
func (*FakeServer) BroadcastOneway ¶
func (f *FakeServer) BroadcastOneway(notif ClusterMessage) error
func (*FakeServer) BroadcastSync ¶
func (f *FakeServer) BroadcastSync(notif ClusterMessage) error
func (*FakeServer) ConnectionCount ¶
func (f *FakeServer) ConnectionCount() int
func (*FakeServer) RegisterMessageHandler ¶
func (f *FakeServer) RegisterMessageHandler(notificationType ClusterMessageType, listener ClusterMessageHandler)
func (*FakeServer) SendRequest ¶
func (f *FakeServer) SendRequest(notif ClusterMessage, timeout time.Duration) (ClusterMessage, error)
func (*FakeServer) Start ¶
func (f *FakeServer) Start() error
func (*FakeServer) Stop ¶
func (f *FakeServer) Stop() error
type HealthChecker ¶
type HealthChecker struct {
// contains filtered or unexported fields
}
func NewHealthChecker ¶
func (*HealthChecker) AddAvailabilityListener ¶
func (h *HealthChecker) AddAvailabilityListener(listener AvailabilityListener)
func (*HealthChecker) Start ¶
func (h *HealthChecker) Start()
func (*HealthChecker) Stop ¶
func (h *HealthChecker) Stop()
type Server ¶
type Server interface { Start() error Stop() error RegisterMessageHandler(messageType ClusterMessageType, listener ClusterMessageHandler) }
Click to show internal directories.
Click to hide internal directories.