Documentation ¶
Overview ¶
Package httpoverrpc defines the RPC interface for the sansshell HTTP actions.
Index ¶
- Constants
- Variables
- func RegisterHTTPOverRPCServer(s grpc.ServiceRegistrar, srv HTTPOverRPCServer)
- type HTTPOverRPCClient
- type HTTPOverRPCClientProxy
- type HTTPOverRPCServer
- type HTTPReply
- func (*HTTPReply) Descriptor() ([]byte, []int)deprecated
- func (x *HTTPReply) GetBody() []byte
- func (x *HTTPReply) GetHeaders() []*Header
- func (x *HTTPReply) GetStatusCode() int32
- func (*HTTPReply) ProtoMessage()
- func (x *HTTPReply) ProtoReflect() protoreflect.Message
- func (x *HTTPReply) Reset()
- func (x *HTTPReply) String() string
- type HTTPRequest
- func (*HTTPRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HTTPRequest) GetBody() []byte
- func (x *HTTPRequest) GetHeaders() []*Header
- func (x *HTTPRequest) GetMethod() string
- func (x *HTTPRequest) GetRequestUri() string
- func (*HTTPRequest) ProtoMessage()
- func (x *HTTPRequest) ProtoReflect() protoreflect.Message
- func (x *HTTPRequest) Reset()
- func (x *HTTPRequest) String() string
- type Header
- type LocalhostHTTPRequest
- func (*LocalhostHTTPRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LocalhostHTTPRequest) GetPort() int32
- func (x *LocalhostHTTPRequest) GetRequest() *HTTPRequest
- func (*LocalhostHTTPRequest) ProtoMessage()
- func (x *LocalhostHTTPRequest) ProtoReflect() protoreflect.Message
- func (x *LocalhostHTTPRequest) Reset()
- func (x *LocalhostHTTPRequest) String() string
- type LocalhostManyResponse
- type UnimplementedHTTPOverRPCServer
- type UnsafeHTTPOverRPCServer
Constants ¶
const (
HTTPOverRPC_Localhost_FullMethodName = "/HTTPOverRPC.HTTPOverRPC/Localhost"
)
Variables ¶
var File_httpoverrpc_proto protoreflect.FileDescriptor
var HTTPOverRPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "HTTPOverRPC.HTTPOverRPC", HandlerType: (*HTTPOverRPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Localhost", Handler: _HTTPOverRPC_Localhost_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "httpoverrpc.proto", }
HTTPOverRPC_ServiceDesc is the grpc.ServiceDesc for HTTPOverRPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHTTPOverRPCServer ¶
func RegisterHTTPOverRPCServer(s grpc.ServiceRegistrar, srv HTTPOverRPCServer)
Types ¶
type HTTPOverRPCClient ¶
type HTTPOverRPCClient interface { // Make an HTTP call to localhost Localhost(ctx context.Context, in *LocalhostHTTPRequest, opts ...grpc.CallOption) (*HTTPReply, error) }
HTTPOverRPCClient is the client API for HTTPOverRPC 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 NewHTTPOverRPCClient ¶
func NewHTTPOverRPCClient(cc grpc.ClientConnInterface) HTTPOverRPCClient
type HTTPOverRPCClientProxy ¶
type HTTPOverRPCClientProxy interface { HTTPOverRPCClient LocalhostOneMany(ctx context.Context, in *LocalhostHTTPRequest, opts ...grpc.CallOption) (<-chan *LocalhostManyResponse, error) }
HTTPOverRPCClientProxy is the superset of HTTPOverRPCClient which additionally includes the OneMany proxy methods
func NewHTTPOverRPCClientProxy ¶
func NewHTTPOverRPCClientProxy(cc *proxy.Conn) HTTPOverRPCClientProxy
NewHTTPOverRPCClientProxy creates a HTTPOverRPCClientProxy for use in proxied connections. NOTE: This takes a proxy.Conn instead of a generic ClientConnInterface as the methods here are only valid in proxy.Conn contexts.
type HTTPOverRPCServer ¶
type HTTPOverRPCServer interface { // Make an HTTP call to localhost Localhost(context.Context, *LocalhostHTTPRequest) (*HTTPReply, error) }
HTTPOverRPCServer is the server API for HTTPOverRPC service. All implementations should embed UnimplementedHTTPOverRPCServer for forward compatibility
type HTTPReply ¶
type HTTPReply struct { StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,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 }
HTTPReply describes the HTTP reply
func (*HTTPReply) Descriptor
deprecated
func (*HTTPReply) GetHeaders ¶
func (*HTTPReply) GetStatusCode ¶
func (*HTTPReply) ProtoMessage ¶
func (*HTTPReply) ProtoMessage()
func (*HTTPReply) ProtoReflect ¶
func (x *HTTPReply) ProtoReflect() protoreflect.Message
type HTTPRequest ¶
type HTTPRequest struct { Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` RequestUri string `protobuf:"bytes,2,opt,name=request_uri,json=requestUri,proto3" json:"request_uri,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 }
HTTPRequest describes the HTTP request
func (*HTTPRequest) Descriptor
deprecated
func (*HTTPRequest) Descriptor() ([]byte, []int)
Deprecated: Use HTTPRequest.ProtoReflect.Descriptor instead.
func (*HTTPRequest) GetBody ¶
func (x *HTTPRequest) GetBody() []byte
func (*HTTPRequest) GetHeaders ¶
func (x *HTTPRequest) GetHeaders() []*Header
func (*HTTPRequest) GetMethod ¶
func (x *HTTPRequest) GetMethod() string
func (*HTTPRequest) GetRequestUri ¶
func (x *HTTPRequest) GetRequestUri() string
func (*HTTPRequest) ProtoMessage ¶
func (*HTTPRequest) ProtoMessage()
func (*HTTPRequest) ProtoReflect ¶
func (x *HTTPRequest) ProtoReflect() protoreflect.Message
func (*HTTPRequest) Reset ¶
func (x *HTTPRequest) Reset()
func (*HTTPRequest) String ¶
func (x *HTTPRequest) String() string
type Header ¶
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 }
func (*Header) Descriptor
deprecated
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type LocalhostHTTPRequest ¶
type LocalhostHTTPRequest struct { Request *HTTPRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` // The port to use for the request on the local host. Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // contains filtered or unexported fields }
func (*LocalhostHTTPRequest) Descriptor
deprecated
func (*LocalhostHTTPRequest) Descriptor() ([]byte, []int)
Deprecated: Use LocalhostHTTPRequest.ProtoReflect.Descriptor instead.
func (*LocalhostHTTPRequest) GetPort ¶
func (x *LocalhostHTTPRequest) GetPort() int32
func (*LocalhostHTTPRequest) GetRequest ¶
func (x *LocalhostHTTPRequest) GetRequest() *HTTPRequest
func (*LocalhostHTTPRequest) ProtoMessage ¶
func (*LocalhostHTTPRequest) ProtoMessage()
func (*LocalhostHTTPRequest) ProtoReflect ¶
func (x *LocalhostHTTPRequest) ProtoReflect() protoreflect.Message
func (*LocalhostHTTPRequest) Reset ¶
func (x *LocalhostHTTPRequest) Reset()
func (*LocalhostHTTPRequest) String ¶
func (x *LocalhostHTTPRequest) String() string
type LocalhostManyResponse ¶
type LocalhostManyResponse struct { Target string // As targets can be duplicated this is the index into the slice passed to proxy.Conn. Index int Resp *HTTPReply Error error }
LocalhostManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.
type UnimplementedHTTPOverRPCServer ¶
type UnimplementedHTTPOverRPCServer struct { }
UnimplementedHTTPOverRPCServer should be embedded to have forward compatible implementations.
func (UnimplementedHTTPOverRPCServer) Localhost ¶
func (UnimplementedHTTPOverRPCServer) Localhost(context.Context, *LocalhostHTTPRequest) (*HTTPReply, error)
type UnsafeHTTPOverRPCServer ¶
type UnsafeHTTPOverRPCServer interface {
// contains filtered or unexported methods
}
UnsafeHTTPOverRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HTTPOverRPCServer will result in compilation errors.