httpoverrpc

package
v1.24.4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package httpoverrpc defines the RPC interface for the sansshell HTTP actions.

Index

Constants

View Source
const (
	HTTPOverRPC_Host_FullMethodName = "/HTTPOverRPC.HTTPOverRPC/Host"
)

Variables

View Source
var File_httpoverrpc_proto protoreflect.FileDescriptor
View Source
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.

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) Descriptor() ([]byte, []int)

Deprecated: Use HTTPReply.ProtoReflect.Descriptor instead.

func (*HTTPReply) GetBody

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

func (*HTTPReply) GetHeaders

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

func (*HTTPReply) GetStatusCode

func (x *HTTPReply) GetStatusCode() int32

func (*HTTPReply) ProtoMessage

func (*HTTPReply) ProtoMessage()

func (*HTTPReply) ProtoReflect

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

func (*HTTPReply) Reset

func (x *HTTPReply) Reset()

func (*HTTPReply) String

func (x *HTTPReply) String() string

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 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) 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 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"`
	// 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) 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 UnimplementedHTTPOverRPCServer

type UnimplementedHTTPOverRPCServer struct {
}

UnimplementedHTTPOverRPCServer should be embedded to have forward compatible implementations.

func (UnimplementedHTTPOverRPCServer) Host added in v1.23.3

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.

Directories

Path Synopsis
Package client provides the client interface for 'httpoverrpc'
Package client provides the client interface for 'httpoverrpc'
Package server implements the sansshell 'httpoverrpc' service.
Package server implements the sansshell 'httpoverrpc' service.

Jump to

Keyboard shortcuts

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