proxy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is an HTTP to GRPC proxy server

func NewServer

func NewServer(api, server interface{}, listener *grpc.Server) (*Server, error)

NewServer creates a proxy from HTTP(S) traffic to server using the methods defined by api api should be the Unimplemented<ServiceName> struct compiled by the protobuf. All methods defined on api MUST start with an HTTP method name server MUST implement the same methods as api without the prepended method names, though it may have others without exposing them to HTTP(S) traffic

func (*Server) Proxy

func (s *Server) Proxy(ctx context.Context, req *proto.Request) (res *proto.Response, err error)

Proxy proxies connections through the server

func (*Server) Serve

func (s *Server) Serve(listener net.Listener) error

Serve starts the server

Jump to

Keyboard shortcuts

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