Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterFileUploadServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterFileUploadServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FileUploadServiceClient) error
- func RegisterFileUploadServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterFileUploadServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FileUploadServiceServer) error
- func RegisterFileUploadServiceServer(s grpc.ServiceRegistrar, srv FileUploadServiceServer)
- type FileUploadServiceClient
- type FileUploadServiceServer
- type FileUploadService_UploadFileClient
- type FileUploadService_UploadFileServer
- type UnimplementedFileUploadServiceServer
- type UnsafeFileUploadServiceServer
- type UploadFileRequest
- func (*UploadFileRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UploadFileRequest) GetChunkData() []byte
- func (m *UploadFileRequest) GetData() isUploadFileRequest_Data
- func (x *UploadFileRequest) GetName() string
- func (*UploadFileRequest) ProtoMessage()
- func (x *UploadFileRequest) ProtoReflect() protoreflect.Message
- func (x *UploadFileRequest) Reset()
- func (x *UploadFileRequest) String() string
- type UploadFileRequest_ChunkData
- type UploadFileRequest_Name
- type UploadFileResponse
- func (*UploadFileResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UploadFileResponse) GetName() string
- func (x *UploadFileResponse) GetSize() int64
- func (*UploadFileResponse) ProtoMessage()
- func (x *UploadFileResponse) ProtoReflect() protoreflect.Message
- func (x *UploadFileResponse) Reset()
- func (x *UploadFileResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var FileUploadService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.rpc.examples.fileupload.v1.FileUploadService", HandlerType: (*FileUploadServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "UploadFile", Handler: _FileUploadService_UploadFile_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "proto/rpc/examples/fileupload/v1/fileupload.proto", }
FileUploadService_ServiceDesc is the grpc.ServiceDesc for FileUploadService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_rpc_examples_fileupload_v1_fileupload_proto protoreflect.FileDescriptor
Functions ¶
func RegisterFileUploadServiceHandler ¶
func RegisterFileUploadServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterFileUploadServiceHandler registers the http handlers for service FileUploadService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterFileUploadServiceHandlerClient ¶
func RegisterFileUploadServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FileUploadServiceClient) error
RegisterFileUploadServiceHandlerClient registers the http handlers for service FileUploadService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "FileUploadServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "FileUploadServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "FileUploadServiceClient" to call the correct interceptors.
func RegisterFileUploadServiceHandlerFromEndpoint ¶
func RegisterFileUploadServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterFileUploadServiceHandlerFromEndpoint is same as RegisterFileUploadServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterFileUploadServiceHandlerServer ¶
func RegisterFileUploadServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FileUploadServiceServer) error
RegisterFileUploadServiceHandlerServer registers the http handlers for service FileUploadService to "mux". UnaryRPC :call FileUploadServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterFileUploadServiceHandlerFromEndpoint instead.
func RegisterFileUploadServiceServer ¶
func RegisterFileUploadServiceServer(s grpc.ServiceRegistrar, srv FileUploadServiceServer)
Types ¶
type FileUploadServiceClient ¶
type FileUploadServiceClient interface { // Due to an issue described by https://github.com/improbable-eng/ts-protoc-gen/pull/264 // we use a streaming response but only expect one response. UploadFile(ctx context.Context, opts ...grpc.CallOption) (FileUploadService_UploadFileClient, error) }
FileUploadServiceClient is the client API for FileUploadService 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 NewFileUploadServiceClient ¶
func NewFileUploadServiceClient(cc grpc.ClientConnInterface) FileUploadServiceClient
type FileUploadServiceServer ¶
type FileUploadServiceServer interface { // Due to an issue described by https://github.com/improbable-eng/ts-protoc-gen/pull/264 // we use a streaming response but only expect one response. UploadFile(FileUploadService_UploadFileServer) error // contains filtered or unexported methods }
FileUploadServiceServer is the server API for FileUploadService service. All implementations must embed UnimplementedFileUploadServiceServer for forward compatibility
type FileUploadService_UploadFileClient ¶
type FileUploadService_UploadFileClient interface { Send(*UploadFileRequest) error Recv() (*UploadFileResponse, error) grpc.ClientStream }
type FileUploadService_UploadFileServer ¶
type FileUploadService_UploadFileServer interface { Send(*UploadFileResponse) error Recv() (*UploadFileRequest, error) grpc.ServerStream }
type UnimplementedFileUploadServiceServer ¶
type UnimplementedFileUploadServiceServer struct { }
UnimplementedFileUploadServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedFileUploadServiceServer) UploadFile ¶
func (UnimplementedFileUploadServiceServer) UploadFile(FileUploadService_UploadFileServer) error
type UnsafeFileUploadServiceServer ¶
type UnsafeFileUploadServiceServer interface {
// contains filtered or unexported methods
}
UnsafeFileUploadServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to FileUploadServiceServer will result in compilation errors.
type UploadFileRequest ¶
type UploadFileRequest struct { // Types that are assignable to Data: // // *UploadFileRequest_Name // *UploadFileRequest_ChunkData Data isUploadFileRequest_Data `protobuf_oneof:"data"` // contains filtered or unexported fields }
func (*UploadFileRequest) Descriptor
deprecated
func (*UploadFileRequest) Descriptor() ([]byte, []int)
Deprecated: Use UploadFileRequest.ProtoReflect.Descriptor instead.
func (*UploadFileRequest) GetChunkData ¶
func (x *UploadFileRequest) GetChunkData() []byte
func (*UploadFileRequest) GetData ¶
func (m *UploadFileRequest) GetData() isUploadFileRequest_Data
func (*UploadFileRequest) GetName ¶
func (x *UploadFileRequest) GetName() string
func (*UploadFileRequest) ProtoMessage ¶
func (*UploadFileRequest) ProtoMessage()
func (*UploadFileRequest) ProtoReflect ¶
func (x *UploadFileRequest) ProtoReflect() protoreflect.Message
func (*UploadFileRequest) Reset ¶
func (x *UploadFileRequest) Reset()
func (*UploadFileRequest) String ¶
func (x *UploadFileRequest) String() string
type UploadFileRequest_ChunkData ¶
type UploadFileRequest_ChunkData struct {
ChunkData []byte `protobuf:"bytes,2,opt,name=chunk_data,json=chunkData,proto3,oneof"`
}
type UploadFileRequest_Name ¶
type UploadFileRequest_Name struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3,oneof"`
}
type UploadFileResponse ¶
type UploadFileResponse struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` // contains filtered or unexported fields }
func (*UploadFileResponse) Descriptor
deprecated
func (*UploadFileResponse) Descriptor() ([]byte, []int)
Deprecated: Use UploadFileResponse.ProtoReflect.Descriptor instead.
func (*UploadFileResponse) GetName ¶
func (x *UploadFileResponse) GetName() string
func (*UploadFileResponse) GetSize ¶
func (x *UploadFileResponse) GetSize() int64
func (*UploadFileResponse) ProtoMessage ¶
func (*UploadFileResponse) ProtoMessage()
func (*UploadFileResponse) ProtoReflect ¶
func (x *UploadFileResponse) ProtoReflect() protoreflect.Message
func (*UploadFileResponse) Reset ¶
func (x *UploadFileResponse) Reset()
func (*UploadFileResponse) String ¶
func (x *UploadFileResponse) String() string