thriftrw: Index | Files | Directories

package envelope

import ""


Package Files

client.go gen.go server.go

type Client Uses

type Client interface {
    // Send sends a request to the method with the given name and body.
    Send(name string, body wire.Value) (wire.Value, error)

Client sends Thrift requests and returns their responses.

Client is thread-safe only if the underlying transport is thread-safe.

func NewClient Uses

func NewClient(p protocol.Protocol, t Transport) Client

NewClient builds a new client which sends requests over the given transport, encoding them using the given protocol.

type ErrUnknownMethod Uses

type ErrUnknownMethod string

ErrUnknownMethod is raised by Handlers to indicate that the given method is invalid.

func (ErrUnknownMethod) Error Uses

func (e ErrUnknownMethod) Error() string

type Handler Uses

type Handler interface {
    // Receives a request to the given method name and returns the response
    // body.
    // Implementations should return ErrUnknownMethod if the method is invalid.
    Handle(name string, body wire.Value) (wire.Value, error)

Handler handles enveloped requests.

type Server Uses

type Server struct {
    // contains filtered or unexported fields

Server allows a Handler to process bytes.

func NewServer Uses

func NewServer(p protocol.Protocol, h Handler) Server

NewServer builds a new server.

func (Server) Handle Uses

func (s Server) Handle(data []byte) ([]byte, error)

Handle handles the given binary payload.

type Transport Uses

type Transport interface {
    Send([]byte) ([]byte, error)

Transport sends and receive binary payloads.


envelopetestPackage envelopetest is a generated GoMock package.

Package envelope imports 6 packages (graph) and is imported by 18 packages. Updated 2021-01-27. Refresh now. Tools for package owners.