v.io: v.io/v23/services/http Index | Files

package http

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

Index

Package Files

http.vdl.go

Variables

var HttpDesc rpc.InterfaceDesc = descHttp

HttpDesc describes the Http interface.

type HttpClientMethods Uses

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 Uses

type HttpClientStub interface {
    HttpClientMethods
}

HttpClientStub embeds HttpClientMethods and is a placeholder for additional management operations.

func HttpClient Uses

func HttpClient(name string) HttpClientStub

HttpClient returns a client stub for Http.

type HttpServerMethods Uses

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 Uses

type HttpServerStub interface {
    HttpServerStubMethods
    // DescribeInterfaces the Http interfaces.
    Describe__() []rpc.InterfaceDesc
}

HttpServerStub adds universal methods to HttpServerStubMethods.

func HttpServer Uses

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 Uses

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 Uses

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.

func (Request) VDLIsZero Uses

func (x Request) VDLIsZero() bool

func (*Request) VDLRead Uses

func (x *Request) VDLRead(dec vdl.Decoder) error

func (Request) VDLReflect Uses

func (Request) VDLReflect(struct {
    Name string `vdl:"v.io/v23/services/http.Request"`
})

func (Request) VDLWrite Uses

func (x Request) VDLWrite(enc vdl.Encoder) error

type Url Uses

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.

func (Url) VDLIsZero Uses

func (x Url) VDLIsZero() bool

func (*Url) VDLRead Uses

func (x *Url) VDLRead(dec vdl.Decoder) error

func (Url) VDLReflect Uses

func (Url) VDLReflect(struct {
    Name string `vdl:"v.io/v23/services/http.Url"`
})

func (Url) VDLWrite Uses

func (x Url) VDLWrite(enc vdl.Encoder) error

Package http imports 5 packages (graph) and is imported by 2 packages. Updated 2020-10-29. Refresh now. Tools for package owners.