record

package
v0.0.0-...-3336bd9 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Log_Produce_FullMethodName       = "/record.Log/Produce"
	Log_Consume_FullMethodName       = "/record.Log/Consume"
	Log_ProduceStream_FullMethodName = "/record.Log/ProduceStream"
	Log_ConsumeStream_FullMethodName = "/record.Log/ConsumeStream"
)

Variables

View Source
var File_record_proto protoreflect.FileDescriptor
View Source
var Log_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "record.Log",
	HandlerType: (*LogServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Produce",
			Handler:    _Log_Produce_Handler,
		},
		{
			MethodName: "Consume",
			Handler:    _Log_Consume_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ProduceStream",
			Handler:       _Log_ProduceStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "ConsumeStream",
			Handler:       _Log_ConsumeStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "record.proto",
}

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

Functions

func RegisterLogServer

func RegisterLogServer(s grpc.ServiceRegistrar, srv LogServer)

Types

type ConsumeRequest

type ConsumeRequest struct {

	// The offset from which to start reading the log.
	Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

Define a message to encapsulate a request to consume (read) a record from the log.

func (*ConsumeRequest) Descriptor deprecated

func (*ConsumeRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConsumeRequest.ProtoReflect.Descriptor instead.

func (*ConsumeRequest) GetOffset

func (x *ConsumeRequest) GetOffset() uint64

func (*ConsumeRequest) ProtoMessage

func (*ConsumeRequest) ProtoMessage()

func (*ConsumeRequest) ProtoReflect

func (x *ConsumeRequest) ProtoReflect() protoreflect.Message

func (*ConsumeRequest) Reset

func (x *ConsumeRequest) Reset()

func (*ConsumeRequest) String

func (x *ConsumeRequest) String() string

type ConsumeResponse

type ConsumeResponse struct {

	// The record that was read from the log.
	Record *Record `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"`
	// contains filtered or unexported fields
}

Define a message to encapsulate the response for a consume request.

func (*ConsumeResponse) Descriptor deprecated

func (*ConsumeResponse) Descriptor() ([]byte, []int)

Deprecated: Use ConsumeResponse.ProtoReflect.Descriptor instead.

func (*ConsumeResponse) GetRecord

func (x *ConsumeResponse) GetRecord() *Record

func (*ConsumeResponse) ProtoMessage

func (*ConsumeResponse) ProtoMessage()

func (*ConsumeResponse) ProtoReflect

func (x *ConsumeResponse) ProtoReflect() protoreflect.Message

func (*ConsumeResponse) Reset

func (x *ConsumeResponse) Reset()

func (*ConsumeResponse) String

func (x *ConsumeResponse) String() string

type LogClient

type LogClient interface {
	// Define a procedure call for producing (appending) a record to the log.
	// Takes a ProduceRequest and returns a ProduceResponse.
	Produce(ctx context.Context, in *ProduceRequest, opts ...grpc.CallOption) (*ProduceResponse, error)
	// Define a procedure call for consuming (reading) a record from the log.
	// Takes a ConsumeRequest and returns a ConsumeResponse.
	Consume(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (*ConsumeResponse, error)
	// Initiates a server-side streaming RPC for producing messages to the log.
	// Clients send a stream of ProduceRequest messages and receive a stream of ProduceResponse messages,
	// allowing for efficient, bidirectional communication.
	ProduceStream(ctx context.Context, opts ...grpc.CallOption) (Log_ProduceStreamClient, error)
	// ConsumeStream streams log entries to a client, starting from a specified offset.
	// Clients call this method to subscribe to log entries being appended to the log.
	// The stream continues sending log entries to the client until the stream is closed
	// by the client or an error occurs.
	ConsumeStream(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (Log_ConsumeStreamClient, error)
}

LogClient is the client API for Log 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 NewLogClient

func NewLogClient(cc grpc.ClientConnInterface) LogClient

type LogServer

type LogServer interface {
	// Define a procedure call for producing (appending) a record to the log.
	// Takes a ProduceRequest and returns a ProduceResponse.
	Produce(context.Context, *ProduceRequest) (*ProduceResponse, error)
	// Define a procedure call for consuming (reading) a record from the log.
	// Takes a ConsumeRequest and returns a ConsumeResponse.
	Consume(context.Context, *ConsumeRequest) (*ConsumeResponse, error)
	// Initiates a server-side streaming RPC for producing messages to the log.
	// Clients send a stream of ProduceRequest messages and receive a stream of ProduceResponse messages,
	// allowing for efficient, bidirectional communication.
	ProduceStream(Log_ProduceStreamServer) error
	// ConsumeStream streams log entries to a client, starting from a specified offset.
	// Clients call this method to subscribe to log entries being appended to the log.
	// The stream continues sending log entries to the client until the stream is closed
	// by the client or an error occurs.
	ConsumeStream(*ConsumeRequest, Log_ConsumeStreamServer) error
	// contains filtered or unexported methods
}

LogServer is the server API for Log service. All implementations must embed UnimplementedLogServer for forward compatibility

type Log_ConsumeStreamClient

type Log_ConsumeStreamClient interface {
	Recv() (*ConsumeResponse, error)
	grpc.ClientStream
}

type Log_ConsumeStreamServer

type Log_ConsumeStreamServer interface {
	Send(*ConsumeResponse) error
	grpc.ServerStream
}

type Log_ProduceStreamClient

type Log_ProduceStreamClient interface {
	Send(*ProduceRequest) error
	Recv() (*ProduceResponse, error)
	grpc.ClientStream
}

type Log_ProduceStreamServer

type Log_ProduceStreamServer interface {
	Send(*ProduceResponse) error
	Recv() (*ProduceRequest, error)
	grpc.ServerStream
}

type ProduceRequest

type ProduceRequest struct {

	// The record to be appended to the log.
	Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
	// contains filtered or unexported fields
}

Define a message to encapsulate a request to produce (append) a record to the log.

func (*ProduceRequest) Descriptor deprecated

func (*ProduceRequest) Descriptor() ([]byte, []int)

Deprecated: Use ProduceRequest.ProtoReflect.Descriptor instead.

func (*ProduceRequest) GetRecord

func (x *ProduceRequest) GetRecord() *Record

func (*ProduceRequest) ProtoMessage

func (*ProduceRequest) ProtoMessage()

func (*ProduceRequest) ProtoReflect

func (x *ProduceRequest) ProtoReflect() protoreflect.Message

func (*ProduceRequest) Reset

func (x *ProduceRequest) Reset()

func (*ProduceRequest) String

func (x *ProduceRequest) String() string

type ProduceResponse

type ProduceResponse struct {

	// The offset where the record was appended in the log.
	Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

Define a message to encapsulate the response for a produce request.

func (*ProduceResponse) Descriptor deprecated

func (*ProduceResponse) Descriptor() ([]byte, []int)

Deprecated: Use ProduceResponse.ProtoReflect.Descriptor instead.

func (*ProduceResponse) GetOffset

func (x *ProduceResponse) GetOffset() uint64

func (*ProduceResponse) ProtoMessage

func (*ProduceResponse) ProtoMessage()

func (*ProduceResponse) ProtoReflect

func (x *ProduceResponse) ProtoReflect() protoreflect.Message

func (*ProduceResponse) Reset

func (x *ProduceResponse) Reset()

func (*ProduceResponse) String

func (x *ProduceResponse) String() string

type Record

type Record struct {
	Value  []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

func (*Record) Descriptor deprecated

func (*Record) Descriptor() ([]byte, []int)

Deprecated: Use Record.ProtoReflect.Descriptor instead.

func (*Record) GetOffset

func (x *Record) GetOffset() uint64

func (*Record) GetValue

func (x *Record) GetValue() []byte

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) ProtoReflect

func (x *Record) ProtoReflect() protoreflect.Message

func (*Record) Reset

func (x *Record) Reset()

func (*Record) String

func (x *Record) String() string

type UnimplementedLogServer

type UnimplementedLogServer struct {
}

UnimplementedLogServer must be embedded to have forward compatible implementations.

func (UnimplementedLogServer) Consume

func (UnimplementedLogServer) ConsumeStream

func (UnimplementedLogServer) Produce

func (UnimplementedLogServer) ProduceStream

type UnsafeLogServer

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

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

Jump to

Keyboard shortcuts

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