Documentation ¶
Index ¶
- Variables
- func RegisterExposedServiceServer(s *grpc.Server, srv ExposedServiceServer)
- type ExposedServiceClient
- type ExposedServiceServer
- type ExposedService_ProxyStreamClient
- type ExposedService_ProxyStreamServer
- type Method
- type MultiVal
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetHeaders() map[string]*MultiVal
- func (x *Request) GetMethod() Method
- func (x *Request) GetParams() map[string]*MultiVal
- func (x *Request) GetPayload() []byte
- func (x *Request) GetProcedure() string
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetPayload() []byte
- func (x *Response) GetStatusCode() uint32
- func (x *Response) GetWriteHeaders() map[string]*MultiVal
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type RoutingInformation
- func (*RoutingInformation) Descriptor() ([]byte, []int)deprecated
- func (x *RoutingInformation) GetHeaders() map[string]*MultiVal
- func (x *RoutingInformation) GetMethod() Method
- func (x *RoutingInformation) GetProcedure() string
- func (*RoutingInformation) ProtoMessage()
- func (x *RoutingInformation) ProtoReflect() protoreflect.Message
- func (x *RoutingInformation) Reset()
- func (x *RoutingInformation) String() string
- type StreamedRequest
- func (*StreamedRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StreamedRequest) GetInit() *RoutingInformation
- func (m *StreamedRequest) GetMessageType() isStreamedRequest_MessageType
- func (x *StreamedRequest) GetRequest() []byte
- func (*StreamedRequest) ProtoMessage()
- func (x *StreamedRequest) ProtoReflect() protoreflect.Message
- func (x *StreamedRequest) Reset()
- func (x *StreamedRequest) String() string
- type StreamedRequest_Init
- type StreamedRequest_Request
- type StreamedResponse
- type UnimplementedExposedServiceServer
- type UnsafeExposedServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Method_name = map[int32]string{ 0: "UNKNOWN", 1: "GET", 2: "HEAD", 3: "POST", 4: "PUT", 5: "DELETE", 6: "CONNECT", 7: "OPTIONS", 8: "TRACE", 9: "PATCH", } Method_value = map[string]int32{ "UNKNOWN": 0, "GET": 1, "HEAD": 2, "POST": 3, "PUT": 4, "DELETE": 5, "CONNECT": 6, "OPTIONS": 7, "TRACE": 8, "PATCH": 9, } )
Enum value maps for Method.
var File_proxy_proto protoreflect.FileDescriptor
Functions ¶
func RegisterExposedServiceServer ¶
func RegisterExposedServiceServer(s *grpc.Server, srv ExposedServiceServer)
Types ¶
type ExposedServiceClient ¶
type ExposedServiceClient interface { // ProxyUnary sends a message to the GRPC API expecting an immediate single response ProxyUnary(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) // ProxyStream handles streamed requests and responses from websockets ProxyStream(ctx context.Context, opts ...grpc.CallOption) (ExposedService_ProxyStreamClient, error) }
ExposedServiceClient is the client API for ExposedService 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 NewExposedServiceClient ¶
func NewExposedServiceClient(cc grpc.ClientConnInterface) ExposedServiceClient
type ExposedServiceServer ¶
type ExposedServiceServer interface { // ProxyUnary sends a message to the GRPC API expecting an immediate single response ProxyUnary(context.Context, *Request) (*Response, error) // ProxyStream handles streamed requests and responses from websockets ProxyStream(ExposedService_ProxyStreamServer) error // contains filtered or unexported methods }
ExposedServiceServer is the server API for ExposedService service. All implementations must embed UnimplementedExposedServiceServer for forward compatibility
type ExposedService_ProxyStreamClient ¶ added in v0.6.0
type ExposedService_ProxyStreamClient interface { Send(*StreamedRequest) error Recv() (*StreamedResponse, error) grpc.ClientStream }
type ExposedService_ProxyStreamServer ¶ added in v0.6.0
type ExposedService_ProxyStreamServer interface { Send(*StreamedResponse) error Recv() (*StreamedRequest, error) grpc.ServerStream }
type Method ¶
type Method int32
All valid HTTP method names
func (Method) Descriptor ¶ added in v0.5.1
func (Method) Descriptor() protoreflect.EnumDescriptor
func (Method) EnumDescriptor
deprecated
func (Method) Number ¶ added in v0.5.1
func (x Method) Number() protoreflect.EnumNumber
func (Method) Type ¶ added in v0.5.1
func (Method) Type() protoreflect.EnumType
type MultiVal ¶
type MultiVal struct { Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` // contains filtered or unexported fields }
func (*MultiVal) Descriptor
deprecated
func (*MultiVal) ProtoMessage ¶
func (*MultiVal) ProtoMessage()
func (*MultiVal) ProtoReflect ¶ added in v0.5.1
func (x *MultiVal) ProtoReflect() protoreflect.Message
type Request ¶
type Request struct { // HTTP method from requestor Method Method `protobuf:"varint,1,opt,name=method,proto3,enum=httpapi.Method" json:"method,omitempty"` // Desired procedure name Procedure string `protobuf:"bytes,2,opt,name=procedure,proto3" json:"procedure,omitempty"` // JSON payload of the request, if present Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // Query params of the request, if present Params map[string]*MultiVal `` /* 153-byte string literal not displayed */ // Headers won't be automatically translated into the GRPC requests, but they should be delivered in case manual conversion is needed Headers map[string]*MultiVal `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
The request data from the HTTP request
func (*Request) Descriptor
deprecated
func (*Request) GetHeaders ¶
func (*Request) GetPayload ¶
func (*Request) GetProcedure ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶ added in v0.5.1
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { // Manually set status code rather than rely on error-handling at the proxy StatusCode uint32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` // JSON data to return to the requestor Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // Headers won't be automatically returned from GRPC requests, but they should be accepted in case manual conversion is needed WriteHeaders map[string]*MultiVal `` /* 185-byte string literal not displayed */ // contains filtered or unexported fields }
The response to send to the requestor
func (*Response) Descriptor
deprecated
func (*Response) GetPayload ¶
func (*Response) GetStatusCode ¶
func (*Response) GetWriteHeaders ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶ added in v0.5.1
func (x *Response) ProtoReflect() protoreflect.Message
type RoutingInformation ¶ added in v0.6.0
type RoutingInformation struct { // HTTP method from requestor Method Method `protobuf:"varint,1,opt,name=method,proto3,enum=httpapi.Method" json:"method,omitempty"` // Desired procedure name Procedure string `protobuf:"bytes,2,opt,name=procedure,proto3" json:"procedure,omitempty"` // Headers won't be automatically translated into the GRPC requests, but they should be delivered in case manual conversion is needed Headers map[string]*MultiVal `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
func (*RoutingInformation) Descriptor
deprecated
added in
v0.6.0
func (*RoutingInformation) Descriptor() ([]byte, []int)
Deprecated: Use RoutingInformation.ProtoReflect.Descriptor instead.
func (*RoutingInformation) GetHeaders ¶ added in v0.6.0
func (x *RoutingInformation) GetHeaders() map[string]*MultiVal
func (*RoutingInformation) GetMethod ¶ added in v0.6.0
func (x *RoutingInformation) GetMethod() Method
func (*RoutingInformation) GetProcedure ¶ added in v0.6.0
func (x *RoutingInformation) GetProcedure() string
func (*RoutingInformation) ProtoMessage ¶ added in v0.6.0
func (*RoutingInformation) ProtoMessage()
func (*RoutingInformation) ProtoReflect ¶ added in v0.6.0
func (x *RoutingInformation) ProtoReflect() protoreflect.Message
func (*RoutingInformation) Reset ¶ added in v0.6.0
func (x *RoutingInformation) Reset()
func (*RoutingInformation) String ¶ added in v0.6.0
func (x *RoutingInformation) String() string
type StreamedRequest ¶ added in v0.6.0
type StreamedRequest struct { // Types that are assignable to MessageType: // *StreamedRequest_Init // *StreamedRequest_Request MessageType isStreamedRequest_MessageType `protobuf_oneof:"message_type"` // contains filtered or unexported fields }
func (*StreamedRequest) Descriptor
deprecated
added in
v0.6.0
func (*StreamedRequest) Descriptor() ([]byte, []int)
Deprecated: Use StreamedRequest.ProtoReflect.Descriptor instead.
func (*StreamedRequest) GetInit ¶ added in v0.6.0
func (x *StreamedRequest) GetInit() *RoutingInformation
func (*StreamedRequest) GetMessageType ¶ added in v0.6.0
func (m *StreamedRequest) GetMessageType() isStreamedRequest_MessageType
func (*StreamedRequest) GetRequest ¶ added in v0.6.0
func (x *StreamedRequest) GetRequest() []byte
func (*StreamedRequest) ProtoMessage ¶ added in v0.6.0
func (*StreamedRequest) ProtoMessage()
func (*StreamedRequest) ProtoReflect ¶ added in v0.6.0
func (x *StreamedRequest) ProtoReflect() protoreflect.Message
func (*StreamedRequest) Reset ¶ added in v0.6.0
func (x *StreamedRequest) Reset()
func (*StreamedRequest) String ¶ added in v0.6.0
func (x *StreamedRequest) String() string
type StreamedRequest_Init ¶ added in v0.6.0
type StreamedRequest_Init struct { // Init will only be sent once on initialisation of the websocket that this stream is linked to, it contains the routing information normally transmitted by the Request message Init *RoutingInformation `protobuf:"bytes,1,opt,name=init,proto3,oneof"` }
type StreamedRequest_Request ¶ added in v0.6.0
type StreamedRequest_Request struct { // Request will be sent for every message but the very first, and is the JSON extracted from the websocket message Request []byte `protobuf:"bytes,2,opt,name=request,proto3,oneof"` }
type StreamedResponse ¶ added in v0.6.0
type StreamedResponse struct { Response []byte `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` // contains filtered or unexported fields }
TODO: work out what we can do here
func (*StreamedResponse) Descriptor
deprecated
added in
v0.6.0
func (*StreamedResponse) Descriptor() ([]byte, []int)
Deprecated: Use StreamedResponse.ProtoReflect.Descriptor instead.
func (*StreamedResponse) GetResponse ¶ added in v0.6.0
func (x *StreamedResponse) GetResponse() []byte
func (*StreamedResponse) ProtoMessage ¶ added in v0.6.0
func (*StreamedResponse) ProtoMessage()
func (*StreamedResponse) ProtoReflect ¶ added in v0.6.0
func (x *StreamedResponse) ProtoReflect() protoreflect.Message
func (*StreamedResponse) Reset ¶ added in v0.6.0
func (x *StreamedResponse) Reset()
func (*StreamedResponse) String ¶ added in v0.6.0
func (x *StreamedResponse) String() string
type UnimplementedExposedServiceServer ¶
type UnimplementedExposedServiceServer struct { }
UnimplementedExposedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedExposedServiceServer) ProxyStream ¶ added in v0.6.0
func (UnimplementedExposedServiceServer) ProxyStream(ExposedService_ProxyStreamServer) error
func (UnimplementedExposedServiceServer) ProxyUnary ¶ added in v0.6.0
type UnsafeExposedServiceServer ¶ added in v0.6.0
type UnsafeExposedServiceServer interface {
// contains filtered or unexported methods
}
UnsafeExposedServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExposedServiceServer will result in compilation errors.