import "v.io/v23/services/http"
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. nolint:golint
var HttpDesc rpc.InterfaceDesc = descHttp
HttpDesc describes the Http interface.
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 interface { HttpClientMethods }
HttpClientStub embeds HttpClientMethods and is a placeholder for additional management operations.
func HttpClient(name string) HttpClientStub
HttpClient returns a client stub for Http.
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 interface { HttpServerStubMethods // DescribeInterfaces the Http interfaces. Describe__() []rpc.InterfaceDesc }
HttpServerStub adds universal methods to HttpServerStubMethods.
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 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 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.
type Url struct { Scheme string Opaque string Host string Path string RawPath string RawQuery string Fragment string }
Url represents a url.URL struct. The User field is skipped since it is a struct with only unexported fields.
Package http imports 5 packages (graph) and is imported by 2 packages. Updated 2020-10-29. Refresh now. Tools for package owners.