Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterGorumsServer(s grpc.ServiceRegistrar, srv GorumsServer)
- type GorumsClient
- type GorumsServer
- type Gorums_NodeStreamClient
- type Gorums_NodeStreamServer
- type Metadata
- func (x *Metadata) AppendToIncomingContext(ctx context.Context) context.Context
- func (x *Metadata) ClearStatus()
- func (x *Metadata) GetEntry() []*MetadataEntry
- func (x *Metadata) GetMessageSeqNo() uint64
- func (x *Metadata) GetMethod() string
- func (x *Metadata) GetStatus() *status.Status
- func (x *Metadata) HasStatus() bool
- func (*Metadata) ProtoMessage()
- func (x *Metadata) ProtoReflect() protoreflect.Message
- func (x *Metadata) Reset()
- func (x *Metadata) SetEntry(v []*MetadataEntry)
- func (x *Metadata) SetMessageSeqNo(v uint64)
- func (x *Metadata) SetMethod(v string)
- func (x *Metadata) SetStatus(v *status.Status)
- func (x *Metadata) String() string
- type MetadataEntry
- func (x *MetadataEntry) GetKey() string
- func (x *MetadataEntry) GetValue() string
- func (*MetadataEntry) ProtoMessage()
- func (x *MetadataEntry) ProtoReflect() protoreflect.Message
- func (x *MetadataEntry) Reset()
- func (x *MetadataEntry) SetKey(v string)
- func (x *MetadataEntry) SetValue(v string)
- func (x *MetadataEntry) String() string
- type MetadataEntry_builder
- type Metadata_builder
- type UnimplementedGorumsServer
- type UnsafeGorumsServer
Constants ¶
const (
Gorums_NodeStream_FullMethodName = "/ordering.Gorums/NodeStream"
)
Variables ¶
var File_ordering_ordering_proto protoreflect.FileDescriptor
var Gorums_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ordering.Gorums", HandlerType: (*GorumsServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "NodeStream", Handler: _Gorums_NodeStream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "ordering/ordering.proto", }
Gorums_ServiceDesc is the grpc.ServiceDesc for Gorums service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGorumsServer ¶
func RegisterGorumsServer(s grpc.ServiceRegistrar, srv GorumsServer)
Types ¶
type GorumsClient ¶
type GorumsClient interface {
// NodeStream is a stream that connects a client to a Node.
// The messages that are sent on the stream contain both Metadata
// and an application-specific message.
NodeStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Metadata, Metadata], error)
}
GorumsClient is the client API for Gorums 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.
Gorums is the main service for Gorums' per-node stream communication.
func NewGorumsClient ¶
func NewGorumsClient(cc grpc.ClientConnInterface) GorumsClient
type GorumsServer ¶
type GorumsServer interface {
// NodeStream is a stream that connects a client to a Node.
// The messages that are sent on the stream contain both Metadata
// and an application-specific message.
NodeStream(grpc.BidiStreamingServer[Metadata, Metadata]) error
// contains filtered or unexported methods
}
GorumsServer is the server API for Gorums service. All implementations must embed UnimplementedGorumsServer for forward compatibility.
Gorums is the main service for Gorums' per-node stream communication.
type Gorums_NodeStreamClient ¶
type Gorums_NodeStreamClient = grpc.BidiStreamingClient[Metadata, Metadata]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Gorums_NodeStreamServer ¶
type Gorums_NodeStreamServer = grpc.BidiStreamingServer[Metadata, Metadata]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata is sent together with application-specific message types, and contains information necessary for Gorums to handle the messages.
func NewGorumsMetadata ¶ added in v0.9.0
NewGorumsMetadata creates a new Gorums metadata object for the given method and client message ID. It also appends any client-specific metadata from the context to the Gorums metadata object.
This is used to pass client-specific metadata to the server via Gorums. This method should be used by generated code only.
func (*Metadata) AppendToIncomingContext ¶ added in v0.9.0
AppendToIncomingContext appends client-specific metadata from the Gorums metadata object to the incoming context.
This is used to pass client-specific metadata from the Gorums runtime to the server implementation. This method should be used by generated code only.
func (*Metadata) ClearStatus ¶ added in v0.8.0
func (x *Metadata) ClearStatus()
func (*Metadata) GetEntry ¶ added in v0.9.0
func (x *Metadata) GetEntry() []*MetadataEntry
func (*Metadata) GetMessageSeqNo ¶ added in v0.11.0
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) ProtoReflect ¶
func (x *Metadata) ProtoReflect() protoreflect.Message
func (*Metadata) SetEntry ¶ added in v0.9.0
func (x *Metadata) SetEntry(v []*MetadataEntry)
func (*Metadata) SetMessageSeqNo ¶ added in v0.11.0
type MetadataEntry ¶ added in v0.9.0
type MetadataEntry struct {
// contains filtered or unexported fields
}
MetadataEntry is a key-value pair for Metadata entries.
func (*MetadataEntry) GetKey ¶ added in v0.9.0
func (x *MetadataEntry) GetKey() string
func (*MetadataEntry) GetValue ¶ added in v0.9.0
func (x *MetadataEntry) GetValue() string
func (*MetadataEntry) ProtoMessage ¶ added in v0.9.0
func (*MetadataEntry) ProtoMessage()
func (*MetadataEntry) ProtoReflect ¶ added in v0.9.0
func (x *MetadataEntry) ProtoReflect() protoreflect.Message
func (*MetadataEntry) Reset ¶ added in v0.9.0
func (x *MetadataEntry) Reset()
func (*MetadataEntry) SetKey ¶ added in v0.9.0
func (x *MetadataEntry) SetKey(v string)
func (*MetadataEntry) SetValue ¶ added in v0.9.0
func (x *MetadataEntry) SetValue(v string)
func (*MetadataEntry) String ¶ added in v0.9.0
func (x *MetadataEntry) String() string
type MetadataEntry_builder ¶ added in v0.9.0
type MetadataEntry_builder struct {
Key string
Value string
// contains filtered or unexported fields
}
func (MetadataEntry_builder) Build ¶ added in v0.9.0
func (b0 MetadataEntry_builder) Build() *MetadataEntry
type Metadata_builder ¶ added in v0.8.0
type Metadata_builder struct {
MessageSeqNo uint64
Method string
Status *status.Status
Entry []*MetadataEntry
// contains filtered or unexported fields
}
func (Metadata_builder) Build ¶ added in v0.8.0
func (b0 Metadata_builder) Build() *Metadata
type UnimplementedGorumsServer ¶
type UnimplementedGorumsServer struct{}
UnimplementedGorumsServer 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 (UnimplementedGorumsServer) NodeStream ¶
func (UnimplementedGorumsServer) NodeStream(grpc.BidiStreamingServer[Metadata, Metadata]) error
type UnsafeGorumsServer ¶ added in v0.3.0
type UnsafeGorumsServer interface {
// contains filtered or unexported methods
}
UnsafeGorumsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GorumsServer will result in compilation errors.