Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterElectionServer(s grpc.ServiceRegistrar, srv ElectionServer)
- func RegisterPeerServer(s grpc.ServiceRegistrar, srv PeerServer)
- func RegisterSyncServer(s grpc.ServiceRegistrar, srv SyncServer)
- type ElectionClient
- type ElectionServer
- type PeerClient
- type PeerServer
- type Peer_SubscribeClient
- type Peer_SubscribeServer
- type SyncClient
- type SyncServer
- type UnimplementedElectionServer
- type UnimplementedPeerServer
- type UnimplementedSyncServer
- type UnsafeElectionServer
- type UnsafePeerServer
- type UnsafeSyncServer
Constants ¶
const ( Election_Election_FullMethodName = "/compogo.cluster.service.replica.Election/Election" Election_Vote_FullMethodName = "/compogo.cluster.service.replica.Election/Vote" )
const (
Peer_Subscribe_FullMethodName = "/compogo.cluster.service.replica.Peer/Subscribe"
)
const (
Sync_Hosts_FullMethodName = "/compogo.cluster.service.replica.Sync/Hosts"
)
Variables ¶
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)
var File_github_com_Compogo_cluster_service_election_proto protoreflect.FileDescriptor
var File_github_com_Compogo_cluster_service_peer_proto protoreflect.FileDescriptor
var File_github_com_Compogo_cluster_service_sync_proto protoreflect.FileDescriptor
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)
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 ¶
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Peer_SubscribeServer ¶
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.
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 ¶
func (UnimplementedPeerServer) Subscribe(grpc.BidiStreamingServer[model.Stream, model.Stream]) error
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.
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.