cluster

package module
v0.0.0-...-a8bce21 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: BSD-2-Clause Imports: 7 Imported by: 0

README

Whatnot Cluster Support

Clustering network implementation for github.com/databeast/whatnot

Incorporates three primary areas of functionality.

  • Cluster Member discovery via Gossip Protocol
  • Cluster Quorum for consistency delegation via Raft Protocol
  • Data synchronization between cluster members over gRPC Protocol

Documentation

Overview

Package cluster provides Clustering support for Whatnot to ease network-driven synchronization of namespace structures across multiple instances

Index

Constants

This section is empty.

Variables

View Source
var LeaseService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "transports.LeaseService",
	HandlerType: (*LeaseServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RequestLease",
			Handler:    _LeaseService_RequestLease_Handler,
		},
		{
			MethodName: "ReleaseLease",
			Handler:    _LeaseService_ReleaseLease_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "whatnotservices.proto",
}

LeaseService_ServiceDesc is the grpc.ServiceDesc for LeaseService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var StatusUpdates_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "transports.StatusUpdates",
	HandlerType: (*StatusUpdatesServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SubscribeToEvents",
			Handler:       _StatusUpdates_SubscribeToEvents_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "whatnotservices.proto",
}

StatusUpdates_ServiceDesc is the grpc.ServiceDesc for StatusUpdates service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var SyncService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "transports.SyncService",
	HandlerType: (*SyncServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Sync",
			Handler:       _SyncService_Sync_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "whatnotservices.proto",
}

SyncService_ServiceDesc is the grpc.ServiceDesc for SyncService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func NewClusterDefinition

func NewClusterDefinition()

func NewSyncServiceForManager

func NewSyncServiceForManager(ctx context.Context, mgr whatnot.NameSpaceManager)

func RegisterLeaseServiceServer

func RegisterLeaseServiceServer(s grpc.ServiceRegistrar, srv LeaseServiceServer)

func RegisterStatusUpdatesServer

func RegisterStatusUpdatesServer(s grpc.ServiceRegistrar, srv StatusUpdatesServer)

func RegisterSyncServiceServer

func RegisterSyncServiceServer(s grpc.ServiceRegistrar, srv SyncServiceServer)

Types

type LeaseServiceClient

type LeaseServiceClient interface {
	RequestLease(ctx context.Context, in *transports.LeaseRequest, opts ...grpc.CallOption) (*transports.LeaseResponse, error)
	ReleaseLease(ctx context.Context, in *transports.LeaseRelease, opts ...grpc.CallOption) (*transports.LeaseReleaseResponse, error)
}

LeaseServiceClient is the client API for LeaseService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type LeaseServiceServer

type LeaseServiceServer interface {
	RequestLease(context.Context, *transports.LeaseRequest) (*transports.LeaseResponse, error)
	ReleaseLease(context.Context, *transports.LeaseRelease) (*transports.LeaseReleaseResponse, error)
	// contains filtered or unexported methods
}

LeaseServiceServer is the server API for LeaseService service. All implementations must embed UnimplementedLeaseServiceServer for forward compatibility

type NamespaceSyncService

type NamespaceSyncService struct {
}

func (NamespaceSyncService) Sync

type StatusUpdatesClient

type StatusUpdatesClient interface {
	SubscribeToEvents(ctx context.Context, in *transports.Subscribe, opts ...grpc.CallOption) (StatusUpdates_SubscribeToEventsClient, error)
}

StatusUpdatesClient is the client API for StatusUpdates service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type StatusUpdatesServer

type StatusUpdatesServer interface {
	SubscribeToEvents(*transports.Subscribe, StatusUpdates_SubscribeToEventsServer) error
	// contains filtered or unexported methods
}

StatusUpdatesServer is the server API for StatusUpdates service. All implementations must embed UnimplementedStatusUpdatesServer for forward compatibility

type StatusUpdates_SubscribeToEventsClient

type StatusUpdates_SubscribeToEventsClient interface {
	Recv() (*transports.StateChange, error)
	grpc.ClientStream
}

type StatusUpdates_SubscribeToEventsServer

type StatusUpdates_SubscribeToEventsServer interface {
	Send(*transports.StateChange) error
	grpc.ServerStream
}

type SyncServiceClient

type SyncServiceClient interface {
	Sync(ctx context.Context, opts ...grpc.CallOption) (SyncService_SyncClient, error)
}

SyncServiceClient is the client API for SyncService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type SyncServiceServer

type SyncServiceServer interface {
	Sync(SyncService_SyncServer) error
	// contains filtered or unexported methods
}

SyncServiceServer is the server API for SyncService service. All implementations must embed UnimplementedSyncServiceServer for forward compatibility

type SyncService_SyncClient

type SyncService_SyncClient interface {
	Send(*transports.NamespaceSync) error
	Recv() (*transports.NamespaceSync, error)
	grpc.ClientStream
}

type SyncService_SyncServer

type SyncService_SyncServer interface {
	Send(*transports.NamespaceSync) error
	Recv() (*transports.NamespaceSync, error)
	grpc.ServerStream
}

type UnimplementedLeaseServiceServer

type UnimplementedLeaseServiceServer struct {
}

UnimplementedLeaseServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedLeaseServiceServer) RequestLease

type UnimplementedStatusUpdatesServer

type UnimplementedStatusUpdatesServer struct {
}

UnimplementedStatusUpdatesServer must be embedded to have forward compatible implementations.

func (UnimplementedStatusUpdatesServer) SubscribeToEvents

type UnimplementedSyncServiceServer

type UnimplementedSyncServiceServer struct {
}

UnimplementedSyncServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSyncServiceServer) Sync

type UnsafeLeaseServiceServer

type UnsafeLeaseServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeLeaseServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LeaseServiceServer will result in compilation errors.

type UnsafeStatusUpdatesServer

type UnsafeStatusUpdatesServer interface {
	// contains filtered or unexported methods
}

UnsafeStatusUpdatesServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StatusUpdatesServer will result in compilation errors.

type UnsafeSyncServiceServer

type UnsafeSyncServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeSyncServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SyncServiceServer will result in compilation errors.

type WhatnotCluster

type WhatnotCluster struct {
	// contains filtered or unexported fields
}

func (*WhatnotCluster) BeginDiscovery

func (c *WhatnotCluster) BeginDiscovery() (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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