service

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Election_Election_FullMethodName = "/compogo.cluster.service.replica.Election/Election"
	Election_Vote_FullMethodName     = "/compogo.cluster.service.replica.Election/Vote"
)
View Source
const (
	Peer_Subscribe_FullMethodName = "/compogo.cluster.service.replica.Peer/Subscribe"
)
View Source
const (
	Sync_Hosts_FullMethodName = "/compogo.cluster.service.replica.Sync/Hosts"
)

Variables

View Source
var Election_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "compogo.cluster.service.replica.Election",
	HandlerType: (*ElectionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Election",
			Handler:    _Election_Election_Handler,
		},
		{
			MethodName: "Vote",
			Handler:    _Election_Vote_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/Compogo/cluster/service/election.proto",
}

Election_ServiceDesc is the grpc.ServiceDesc for Election 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 File_github_com_Compogo_cluster_service_election_proto protoreflect.FileDescriptor
View Source
var File_github_com_Compogo_cluster_service_peer_proto protoreflect.FileDescriptor
View Source
var File_github_com_Compogo_cluster_service_sync_proto protoreflect.FileDescriptor
View Source
var Peer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "compogo.cluster.service.replica.Peer",
	HandlerType: (*PeerServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _Peer_Subscribe_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "github.com/Compogo/cluster/service/peer.proto",
}

Peer_ServiceDesc is the grpc.ServiceDesc for Peer 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 Sync_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "compogo.cluster.service.replica.Sync",
	HandlerType: (*SyncServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Hosts",
			Handler:    _Sync_Hosts_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/Compogo/cluster/service/sync.proto",
}

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

Functions

func RegisterElectionServer

func RegisterElectionServer(s grpc.ServiceRegistrar, srv ElectionServer)

func RegisterPeerServer

func RegisterPeerServer(s grpc.ServiceRegistrar, srv PeerServer)

func RegisterSyncServer

func RegisterSyncServer(s grpc.ServiceRegistrar, srv SyncServer)

Types

type ElectionClient

type ElectionClient interface {
	Election(ctx context.Context, in *model.Age, opts ...grpc.CallOption) (*model.Age, error)
	Vote(ctx context.Context, in *model.Bulletin, opts ...grpc.CallOption) (*model.Bulletin, error)
}

ElectionClient is the client API for Election 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.

func NewElectionClient

func NewElectionClient(cc grpc.ClientConnInterface) ElectionClient

type ElectionServer

type ElectionServer interface {
	Election(context.Context, *model.Age) (*model.Age, error)
	Vote(context.Context, *model.Bulletin) (*model.Bulletin, error)
	// contains filtered or unexported methods
}

ElectionServer is the server API for Election service. All implementations must embed UnimplementedElectionServer for forward compatibility.

type PeerClient

type PeerClient interface {
	Subscribe(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[model.Stream, model.Stream], error)
}

PeerClient is the client API for Peer 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.

func NewPeerClient

func NewPeerClient(cc grpc.ClientConnInterface) PeerClient

type PeerServer

type PeerServer interface {
	Subscribe(grpc.BidiStreamingServer[model.Stream, model.Stream]) error
	// contains filtered or unexported methods
}

PeerServer is the server API for Peer service. All implementations must embed UnimplementedPeerServer for forward compatibility.

type Peer_SubscribeClient

type Peer_SubscribeClient = grpc.BidiStreamingClient[model.Stream, model.Stream]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Peer_SubscribeServer

type Peer_SubscribeServer = grpc.BidiStreamingServer[model.Stream, model.Stream]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type SyncClient

type SyncClient interface {
	Hosts(ctx context.Context, in *model.Sync, opts ...grpc.CallOption) (*model.Sync, error)
}

SyncClient is the client API for Sync 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.

func NewSyncClient

func NewSyncClient(cc grpc.ClientConnInterface) SyncClient

type SyncServer

type SyncServer interface {
	Hosts(context.Context, *model.Sync) (*model.Sync, error)
	// contains filtered or unexported methods
}

SyncServer is the server API for Sync service. All implementations must embed UnimplementedSyncServer for forward compatibility.

type UnimplementedElectionServer

type UnimplementedElectionServer struct{}

UnimplementedElectionServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedElectionServer) Election

func (UnimplementedElectionServer) Vote

type UnimplementedPeerServer

type UnimplementedPeerServer struct{}

UnimplementedPeerServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedPeerServer) Subscribe

type UnimplementedSyncServer

type UnimplementedSyncServer struct{}

UnimplementedSyncServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedSyncServer) Hosts

type UnsafeElectionServer

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

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

type UnsafePeerServer

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

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

type UnsafeSyncServer

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

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

Jump to

Keyboard shortcuts

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