reader

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: BSD-3-Clause Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Reader_Read_FullMethodName = "/io.reader.Reader/Read"
)

Variables

View Source
var (
	ErrorCode_name = map[int32]string{
		0: "ERROR_CODE_UNSPECIFIED",
		1: "ERROR_CODE_EOF",
	}
	ErrorCode_value = map[string]int32{
		"ERROR_CODE_UNSPECIFIED": 0,
		"ERROR_CODE_EOF":         1,
	}
)

Enum value maps for ErrorCode.

View Source
var File_io_reader_reader_proto protoreflect.FileDescriptor
View Source
var Reader_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "io.reader.Reader",
	HandlerType: (*ReaderServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Read",
			Handler:    _Reader_Read_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "io/reader/reader.proto",
}

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

Functions

func RegisterReaderServer

func RegisterReaderServer(s grpc.ServiceRegistrar, srv ReaderServer)

Types

type Error

type Error struct {
	ErrorCode ErrorCode `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=io.reader.ErrorCode" json:"error_code,omitempty"`
	Message   string    `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetErrorCode

func (x *Error) GetErrorCode() ErrorCode

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type ErrorCode

type ErrorCode int32

ErrorCode provides information for special sentinel error types

const (
	ErrorCode_ERROR_CODE_UNSPECIFIED ErrorCode = 0
	ErrorCode_ERROR_CODE_EOF         ErrorCode = 1
)

func (ErrorCode) Descriptor

func (ErrorCode) Descriptor() protoreflect.EnumDescriptor

func (ErrorCode) Enum

func (x ErrorCode) Enum() *ErrorCode

func (ErrorCode) EnumDescriptor deprecated

func (ErrorCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use ErrorCode.Descriptor instead.

func (ErrorCode) Number

func (x ErrorCode) Number() protoreflect.EnumNumber

func (ErrorCode) String

func (x ErrorCode) String() string

func (ErrorCode) Type

type ReadRequest

type ReadRequest struct {

	// length is the request in bytes
	Length int32 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"`
	// 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() int32

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 ReadResponse

type ReadResponse struct {

	// read is the payload in bytes
	Read []byte `protobuf:"bytes,1,opt,name=read,proto3" json:"read,omitempty"`
	// error is an error message
	Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadResponse) Descriptor deprecated

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

Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.

func (*ReadResponse) GetError

func (x *ReadResponse) GetError() *Error

func (*ReadResponse) GetRead

func (x *ReadResponse) GetRead() []byte

func (*ReadResponse) ProtoMessage

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) ProtoReflect

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

func (*ReadResponse) Reset

func (x *ReadResponse) Reset()

func (*ReadResponse) String

func (x *ReadResponse) String() string

type ReaderClient

type ReaderClient interface {
	Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
}

ReaderClient is the client API for Reader 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.

Reader is an io.Reader see: https://pkg.go.dev/io#Reader

func NewReaderClient

func NewReaderClient(cc grpc.ClientConnInterface) ReaderClient

type ReaderServer

type ReaderServer interface {
	Read(context.Context, *ReadRequest) (*ReadResponse, error)
	// contains filtered or unexported methods
}

ReaderServer is the server API for Reader service. All implementations must embed UnimplementedReaderServer for forward compatibility.

Reader is an io.Reader see: https://pkg.go.dev/io#Reader

type UnimplementedReaderServer

type UnimplementedReaderServer struct{}

UnimplementedReaderServer 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 (UnimplementedReaderServer) Read

type UnsafeReaderServer

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

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

Jump to

Keyboard shortcuts

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