Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterBenchServiceServer(s grpc.ServiceRegistrar, srv BenchServiceServer)
- type BenchServiceClient
- type BenchServiceServer
- type BenchService_DownloadClient
- type BenchService_DownloadServer
- type Chunk
- type DownloadRequest
- func (*DownloadRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DownloadRequest) GetChunkSize() uint32
- func (x *DownloadRequest) GetStartOffset() uint64
- func (x *DownloadRequest) GetTotalBytes() uint64
- func (*DownloadRequest) ProtoMessage()
- func (x *DownloadRequest) ProtoReflect() protoreflect.Message
- func (x *DownloadRequest) Reset()
- func (x *DownloadRequest) String() string
- type EchoReply
- type EchoRequest
- type ReadReply
- type ReadRequest
- func (*ReadRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReadRequest) GetLength() uint32
- func (x *ReadRequest) GetOffset() uint64
- func (*ReadRequest) ProtoMessage()
- func (x *ReadRequest) ProtoReflect() protoreflect.Message
- func (x *ReadRequest) Reset()
- func (x *ReadRequest) String() string
- type UnimplementedBenchServiceServer
- type UnsafeBenchServiceServer
Constants ¶
const ( BenchService_Echo_FullMethodName = "/bench.BenchService/Echo" BenchService_Download_FullMethodName = "/bench.BenchService/Download" BenchService_Read_FullMethodName = "/bench.BenchService/Read" )
Variables ¶
var BenchService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "bench.BenchService", HandlerType: (*BenchServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _BenchService_Echo_Handler, }, { MethodName: "Read", Handler: _BenchService_Read_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Download", Handler: _BenchService_Download_Handler, ServerStreams: true, }, }, Metadata: "pkg/transport/proto/bench.proto", }
BenchService_ServiceDesc is the grpc.ServiceDesc for BenchService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_pkg_transport_proto_bench_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBenchServiceServer ¶
func RegisterBenchServiceServer(s grpc.ServiceRegistrar, srv BenchServiceServer)
Types ¶
type BenchServiceClient ¶
type BenchServiceClient interface {
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoReply, error)
Download(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Chunk], error)
// Read is a fast unary range read (the FUSE cache-miss path): one small round trip on
// the QUIC interactive channel, isolated from TCP bulk.
Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadReply, error)
}
BenchServiceClient is the client API for BenchService 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.
BenchService measures gRPC over QUIC vs TCP. Echo = unary round-trip latency; Download mirrors KeibiDrop's StreamFile (one request -> stream of chunks) for throughput.
func NewBenchServiceClient ¶
func NewBenchServiceClient(cc grpc.ClientConnInterface) BenchServiceClient
type BenchServiceServer ¶
type BenchServiceServer interface {
Echo(context.Context, *EchoRequest) (*EchoReply, error)
Download(*DownloadRequest, grpc.ServerStreamingServer[Chunk]) error
// Read is a fast unary range read (the FUSE cache-miss path): one small round trip on
// the QUIC interactive channel, isolated from TCP bulk.
Read(context.Context, *ReadRequest) (*ReadReply, error)
// contains filtered or unexported methods
}
BenchServiceServer is the server API for BenchService service. All implementations must embed UnimplementedBenchServiceServer for forward compatibility.
BenchService measures gRPC over QUIC vs TCP. Echo = unary round-trip latency; Download mirrors KeibiDrop's StreamFile (one request -> stream of chunks) for throughput.
type BenchService_DownloadClient ¶
type BenchService_DownloadClient = grpc.ServerStreamingClient[Chunk]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BenchService_DownloadServer ¶
type BenchService_DownloadServer = grpc.ServerStreamingServer[Chunk]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Chunk ¶
type Chunk struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // byte offset of this chunk within the stream
// contains filtered or unexported fields
}
func (*Chunk) Descriptor
deprecated
func (*Chunk) ProtoMessage ¶
func (*Chunk) ProtoMessage()
func (*Chunk) ProtoReflect ¶
func (x *Chunk) ProtoReflect() protoreflect.Message
type DownloadRequest ¶
type DownloadRequest struct {
TotalBytes uint64 `protobuf:"varint,1,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"` // total size of the transfer
ChunkSize uint32 `protobuf:"varint,2,opt,name=chunk_size,json=chunkSize,proto3" json:"chunk_size,omitempty"` // bytes per Chunk (0 -> server default)
StartOffset uint64 `protobuf:"varint,3,opt,name=start_offset,json=startOffset,proto3" json:"start_offset,omitempty"` // resume point: stream from here to total_bytes (0 = from start)
// contains filtered or unexported fields
}
func (*DownloadRequest) Descriptor
deprecated
func (*DownloadRequest) Descriptor() ([]byte, []int)
Deprecated: Use DownloadRequest.ProtoReflect.Descriptor instead.
func (*DownloadRequest) GetChunkSize ¶
func (x *DownloadRequest) GetChunkSize() uint32
func (*DownloadRequest) GetStartOffset ¶
func (x *DownloadRequest) GetStartOffset() uint64
func (*DownloadRequest) GetTotalBytes ¶
func (x *DownloadRequest) GetTotalBytes() uint64
func (*DownloadRequest) ProtoMessage ¶
func (*DownloadRequest) ProtoMessage()
func (*DownloadRequest) ProtoReflect ¶
func (x *DownloadRequest) ProtoReflect() protoreflect.Message
func (*DownloadRequest) Reset ¶
func (x *DownloadRequest) Reset()
func (*DownloadRequest) String ¶
func (x *DownloadRequest) String() string
type EchoReply ¶
type EchoReply struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
// contains filtered or unexported fields
}
func (*EchoReply) Descriptor
deprecated
func (*EchoReply) GetPayload ¶
func (*EchoReply) ProtoMessage ¶
func (*EchoReply) ProtoMessage()
func (*EchoReply) ProtoReflect ¶
func (x *EchoReply) ProtoReflect() protoreflect.Message
type EchoRequest ¶
type EchoRequest struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
// contains filtered or unexported fields
}
func (*EchoRequest) Descriptor
deprecated
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetPayload ¶
func (x *EchoRequest) GetPayload() []byte
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) ProtoReflect ¶
func (x *EchoRequest) ProtoReflect() protoreflect.Message
func (*EchoRequest) Reset ¶
func (x *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (x *EchoRequest) String() string
type ReadReply ¶
type ReadReply struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
func (*ReadReply) Descriptor
deprecated
func (*ReadReply) ProtoMessage ¶
func (*ReadReply) ProtoMessage()
func (*ReadReply) ProtoReflect ¶
func (x *ReadReply) ProtoReflect() protoreflect.Message
type ReadRequest ¶
type ReadRequest struct {
Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` // byte offset within the file
Length uint32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` // bytes to read
// contains filtered or unexported fields
}
func (*ReadRequest) Descriptor
deprecated
func (*ReadRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.
func (*ReadRequest) GetLength ¶
func (x *ReadRequest) GetLength() uint32
func (*ReadRequest) GetOffset ¶
func (x *ReadRequest) GetOffset() uint64
func (*ReadRequest) ProtoMessage ¶
func (*ReadRequest) ProtoMessage()
func (*ReadRequest) ProtoReflect ¶
func (x *ReadRequest) ProtoReflect() protoreflect.Message
func (*ReadRequest) Reset ¶
func (x *ReadRequest) Reset()
func (*ReadRequest) String ¶
func (x *ReadRequest) String() string
type UnimplementedBenchServiceServer ¶
type UnimplementedBenchServiceServer struct{}
UnimplementedBenchServiceServer 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 (UnimplementedBenchServiceServer) Download ¶
func (UnimplementedBenchServiceServer) Download(*DownloadRequest, grpc.ServerStreamingServer[Chunk]) error
func (UnimplementedBenchServiceServer) Echo ¶
func (UnimplementedBenchServiceServer) Echo(context.Context, *EchoRequest) (*EchoReply, error)
func (UnimplementedBenchServiceServer) Read ¶
func (UnimplementedBenchServiceServer) Read(context.Context, *ReadRequest) (*ReadReply, error)
type UnsafeBenchServiceServer ¶
type UnsafeBenchServiceServer interface {
// contains filtered or unexported methods
}
UnsafeBenchServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BenchServiceServer will result in compilation errors.