httpovergrpc

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_httpovergrpc_proto protoreflect.FileDescriptor
View Source
var HTTPOverGRPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "httpovergrpc.HTTPOverGRPC",
	HandlerType: (*HTTPOverGRPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "HTTPRequest",
			Handler:    _HTTPOverGRPC_HTTPRequest_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "httpovergrpc.proto",
}

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

Functions

func RegisterHTTPOverGRPCServer

func RegisterHTTPOverGRPCServer(s grpc.ServiceRegistrar, srv HTTPOverGRPCServer)

Types

type HTTPOverGRPCClient

type HTTPOverGRPCClient interface {
	// Perform the given HTTP request over gRPC.
	HTTPRequest(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

HTTPOverGRPCClient is the client API for HTTPOverGRPC 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 HTTPOverGRPCServer

type HTTPOverGRPCServer interface {
	// Perform the given HTTP request over gRPC.
	HTTPRequest(context.Context, *Request) (*Response, error)
	// contains filtered or unexported methods
}

HTTPOverGRPCServer is the server API for HTTPOverGRPC service. All implementations must embed UnimplementedHTTPOverGRPCServer for forward compatibility

type Header struct {
	Key    string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

Represents an HTTP 1.1 header.

func (*Header) Descriptor deprecated

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

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetKey

func (x *Header) GetKey() string

func (*Header) GetValues

func (x *Header) GetValues() []string

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

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

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

type Request

type Request struct {
	Method  string    `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	Url     string    `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	Headers []*Header `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty"`
	Body    []byte    `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

Represents an HTTP 1.1 request.

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetBody

func (x *Request) GetBody() []byte

func (*Request) GetHeaders

func (x *Request) GetHeaders() []*Header

func (*Request) GetMethod

func (x *Request) GetMethod() string

func (*Request) GetUrl

func (x *Request) GetUrl() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {
	Status  int32     `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
	Headers []*Header `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"`
	Body    []byte    `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

Represents an HTTP 1.1 response.

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetBody

func (x *Response) GetBody() []byte

func (*Response) GetHeaders

func (x *Response) GetHeaders() []*Header

func (*Response) GetStatus

func (x *Response) GetStatus() int32

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type UnimplementedHTTPOverGRPCServer

type UnimplementedHTTPOverGRPCServer struct {
}

UnimplementedHTTPOverGRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedHTTPOverGRPCServer) HTTPRequest

type UnsafeHTTPOverGRPCServer

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

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

Jump to

Keyboard shortcuts

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