remoting

package
v0.1.1-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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
}

func NewClient

func NewClient(serverAddresses ...string) Client

type ClusterMessage

type ClusterMessage = proto.Message

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 NewHealthChecker(serverAddresses []string, hbTimeout time.Duration, hbInterval time.Duration) *HealthChecker

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)
}

func NewServer

func NewServer(listenAddress string) Server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL