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 HostHTTPRequest
- func (*HostHTTPRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HostHTTPRequest) GetHostname() string
- func (x *HostHTTPRequest) GetPort() int32
- func (x *HostHTTPRequest) GetProtocol() string
- func (x *HostHTTPRequest) GetRequest() *HTTPRequest
- func (x *HostHTTPRequest) GetTlsconfig() *TLSConfig
- func (*HostHTTPRequest) ProtoMessage()
- func (x *HostHTTPRequest) ProtoReflect() protoreflect.Message
- func (x *HostHTTPRequest) Reset()
- func (x *HostHTTPRequest) String() string
- type HostManyResponse
- type TLSConfig
- type UnimplementedHTTPOverRPCServer
- type UnsafeHTTPOverRPCServer
Constants ¶
const (
HTTPOverRPC_Host_FullMethodName = "/HTTPOverRPC.HTTPOverRPC/Host"
)
Variables ¶
var File_httpoverrpc_proto protoreflect.FileDescriptor
var HTTPOverRPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "HTTPOverRPC.HTTPOverRPC", HandlerType: (*HTTPOverRPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Host", Handler: _HTTPOverRPC_Host_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 specified host Host(ctx context.Context, in *HostHTTPRequest, 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 HostOneMany(ctx context.Context, in *HostHTTPRequest, opts ...grpc.CallOption) (<-chan *HostManyResponse, 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 specified host Host(context.Context, *HostHTTPRequest) (*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 HostHTTPRequest ¶ added in v1.23.3
type HostHTTPRequest 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"` // Hostname can be specified as either an ip address or domain name Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` // Protocols for communication like http and https Protocol string `protobuf:"bytes,4,opt,name=protocol,proto3" json:"protocol,omitempty"` // TLS Config for the request Tlsconfig *TLSConfig `protobuf:"bytes,5,opt,name=tlsconfig,proto3" json:"tlsconfig,omitempty"` // contains filtered or unexported fields }
func (*HostHTTPRequest) Descriptor
deprecated
added in
v1.23.3
func (*HostHTTPRequest) Descriptor() ([]byte, []int)
Deprecated: Use HostHTTPRequest.ProtoReflect.Descriptor instead.
func (*HostHTTPRequest) GetHostname ¶ added in v1.23.3
func (x *HostHTTPRequest) GetHostname() string
func (*HostHTTPRequest) GetPort ¶ added in v1.23.3
func (x *HostHTTPRequest) GetPort() int32
func (*HostHTTPRequest) GetProtocol ¶ added in v1.23.3
func (x *HostHTTPRequest) GetProtocol() string
func (*HostHTTPRequest) GetRequest ¶ added in v1.23.3
func (x *HostHTTPRequest) GetRequest() *HTTPRequest
func (*HostHTTPRequest) GetTlsconfig ¶ added in v1.24.6
func (x *HostHTTPRequest) GetTlsconfig() *TLSConfig
func (*HostHTTPRequest) ProtoMessage ¶ added in v1.23.3
func (*HostHTTPRequest) ProtoMessage()
func (*HostHTTPRequest) ProtoReflect ¶ added in v1.23.3
func (x *HostHTTPRequest) ProtoReflect() protoreflect.Message
func (*HostHTTPRequest) Reset ¶ added in v1.23.3
func (x *HostHTTPRequest) Reset()
func (*HostHTTPRequest) String ¶ added in v1.23.3
func (x *HostHTTPRequest) String() string
type HostManyResponse ¶ added in v1.23.3
type HostManyResponse 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 }
HostManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.
type TLSConfig ¶ added in v1.24.6
type TLSConfig struct { InsecureSkipVerify bool `protobuf:"varint,1,opt,name=insecureSkipVerify,proto3" json:"insecureSkipVerify,omitempty"` // contains filtered or unexported fields }
func (*TLSConfig) Descriptor
deprecated
added in
v1.24.6
func (*TLSConfig) GetInsecureSkipVerify ¶ added in v1.24.6
func (*TLSConfig) ProtoMessage ¶ added in v1.24.6
func (*TLSConfig) ProtoMessage()
func (*TLSConfig) ProtoReflect ¶ added in v1.24.6
func (x *TLSConfig) ProtoReflect() protoreflect.Message
type UnimplementedHTTPOverRPCServer ¶
type UnimplementedHTTPOverRPCServer struct { }
UnimplementedHTTPOverRPCServer should be embedded to have forward compatible implementations.
func (UnimplementedHTTPOverRPCServer) Host ¶ added in v1.23.3
func (UnimplementedHTTPOverRPCServer) Host(context.Context, *HostHTTPRequest) (*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.