v1

package
v0.1.85 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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)

View Source
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.

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

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

Jump to

Keyboard shortcuts

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