thrift

package
v0.0.0-...-d0c200b Latest Latest
Warning

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

Go to latest
Published: May 23, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package thrift contains functionality for converting generic data structures to and from Thrift payloads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSuccess

func CheckSuccess(spec *compile.FunctionSpec, responseBytes []byte) error

CheckSuccess returns an error if the result is not successful. A response is successful if: - Thrift deserialization is successful (lazy fields are not evaluated) - Only Field ID 0 (if the method has a return type) or no fields are set.

func Parse

func Parse(file string) (*compile.Module, error)

Parse parses the given Thrift file.

func RequestToBytes

func RequestToBytes(method *compile.FunctionSpec, request map[string]interface{}) ([]byte, error)

RequestToBytes takes a user request and converts it to the Thrift binary payload. It uses the method spec to convert the user request.

func ResponseBytesToMap

func ResponseBytesToMap(spec *compile.FunctionSpec, responseBytes []byte) (map[string]interface{}, error)

ResponseBytesToMap takes the given response bytes and creates a map that uses field name as keys.

func SplitMethod

func SplitMethod(fullMethod string) (svc, method string, err error)

SplitMethod takes a method name like Service::Method and splits it into Service and Method.

Types

This section is empty.

Jump to

Keyboard shortcuts

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