Documentation ¶
Overview ¶
Package HTTP defines an interface to send a http.Request from a client to a Vanadium server. This code is Go-specific since it is only used internally by Vanadium.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HttpDesc rpc.InterfaceDesc = descHttp
HttpDesc describes the Http interface.
Functions ¶
This section is empty.
Types ¶
type HttpClientMethods ¶
type HttpClientMethods interface { // RawDo returns the server's response to req. RawDo(_ *context.T, req Request, _ ...rpc.CallOpt) (data []byte, _ error) }
HttpClientMethods is the client interface containing Http methods.
type HttpClientStub ¶
type HttpClientStub interface { HttpClientMethods }
HttpClientStub embeds HttpClientMethods and is a placeholder for additional management operations.
func HttpClient ¶
func HttpClient(name string) HttpClientStub
HttpClient returns a client stub for Http.
type HttpServerMethods ¶
type HttpServerMethods interface { // RawDo returns the server's response to req. RawDo(_ *context.T, _ rpc.ServerCall, req Request) (data []byte, _ error) }
HttpServerMethods is the interface a server writer implements for Http.
type HttpServerStub ¶
type HttpServerStub interface { HttpServerStubMethods // DescribeInterfaces the Http interfaces. Describe__() []rpc.InterfaceDesc }
HttpServerStub adds universal methods to HttpServerStubMethods.
func HttpServer ¶
func HttpServer(impl HttpServerMethods) HttpServerStub
HttpServer returns a server stub for Http. It converts an implementation of HttpServerMethods into an object that may be used by rpc.Server.
type HttpServerStubMethods ¶
type HttpServerStubMethods HttpServerMethods
HttpServerStubMethods is the server interface containing Http methods, as expected by rpc.Server. There is no difference between this interface and HttpServerMethods since there are no streaming methods.
type Request ¶
type Request struct { Method string Url Url Proto string ProtoMajor int16 ProtoMinor int16 Header map[string][]string Body []byte ContentLength int64 TransferEncoding []string Close bool Host string Form map[string][]string PostForm map[string][]string Trailer map[string][]string RemoteAddr string RequestUri string }
Request represents the http.Request struct. The MultipartForm field is skipped since the docs indicate that it is ignored by clients in favor of the Body field.