tunnel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_tunnel_proto protoreflect.FileDescriptor

Functions

func NewTunnelEndpoints

func NewTunnelEndpoints() []*api.Endpoint

func RegisterTunnelHandler

func RegisterTunnelHandler(s server.Server, hdlr TunnelHandler, opts ...server.HandlerOption) error

Types

type SendRequest

type SendRequest struct {

	// method of the request e.g GET, POST, DELETE
	Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	// host to send to e.g www.google.com
	Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	// path to request e.g /news
	Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	// headers to include e.g Content-Type: application/json
	Headers map[string]string `` /* 155-byte string literal not displayed */
	// request params to include
	Params map[string]string `` /* 153-byte string literal not displayed */
	// body of the request
	Body string `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"`
	// alternative full url e.g https://www.google.com/news
	Url string `protobuf:"bytes,7,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

Send a request through the tunnel

func (*SendRequest) Descriptor deprecated

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

Deprecated: Use SendRequest.ProtoReflect.Descriptor instead.

func (*SendRequest) GetBody

func (x *SendRequest) GetBody() string

func (*SendRequest) GetHeaders

func (x *SendRequest) GetHeaders() map[string]string

func (*SendRequest) GetHost

func (x *SendRequest) GetHost() string

func (*SendRequest) GetMethod

func (x *SendRequest) GetMethod() string

func (*SendRequest) GetParams

func (x *SendRequest) GetParams() map[string]string

func (*SendRequest) GetPath

func (x *SendRequest) GetPath() string

func (*SendRequest) GetUrl

func (x *SendRequest) GetUrl() string

func (*SendRequest) ProtoMessage

func (*SendRequest) ProtoMessage()

func (*SendRequest) ProtoReflect

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

func (*SendRequest) Reset

func (x *SendRequest) Reset()

func (*SendRequest) String

func (x *SendRequest) String() string

type SendResponse

type SendResponse struct {

	// the status
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// the status code
	StatusCode int32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	// headers to include e.g Content-Type: application/json
	Headers map[string]string `` /* 155-byte string literal not displayed */
	// body of the response
	Body string `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*SendResponse) Descriptor deprecated

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

Deprecated: Use SendResponse.ProtoReflect.Descriptor instead.

func (*SendResponse) GetBody

func (x *SendResponse) GetBody() string

func (*SendResponse) GetHeaders

func (x *SendResponse) GetHeaders() map[string]string

func (*SendResponse) GetStatus

func (x *SendResponse) GetStatus() string

func (*SendResponse) GetStatusCode

func (x *SendResponse) GetStatusCode() int32

func (*SendResponse) ProtoMessage

func (*SendResponse) ProtoMessage()

func (*SendResponse) ProtoReflect

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

func (*SendResponse) Reset

func (x *SendResponse) Reset()

func (*SendResponse) String

func (x *SendResponse) String() string

type TunnelHandler

type TunnelHandler interface {
	Send(context.Context, *SendRequest, *SendResponse) error
}

type TunnelService

type TunnelService interface {
	Send(ctx context.Context, in *SendRequest, opts ...client.CallOption) (*SendResponse, error)
}

func NewTunnelService

func NewTunnelService(name string, c client.Client) TunnelService

Jump to

Keyboard shortcuts

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