transport

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPOptions

type HTTPOptions struct {
	URLs          []string
	SourceService string
	TargetService string
}

HTTPOptions are used to create a HTTP transport.

type Request

type Request struct {
	Method  string
	Timeout time.Duration
	Headers map[string]string
	Body    []byte
}

Request is the fields used to make an RPC.

type Response

type Response struct {
	Headers map[string]string
	Body    []byte
	Trace   string
}

Response represents the result of an RPC.

type TChannelOptions

type TChannelOptions struct {
	// SourceService is the service name on the source side.
	SourceService string

	// TargetService is the service name being targeted.
	TargetService string

	// LogLevel overrides the default LogLevel (Warn).
	LogLevel *tchannel.LogLevel

	// HostPorts is a list of host:ports to add to the channel.
	HostPorts []string

	// Encoding is used to set the TChannel format ("as" header).
	Encoding string

	// TraceSampleRate sets the sample rate for tracing.
	TraceSampleRate float64

	// TransportOpts are a list of options, mostly used to add or override
	// TChannel's transport headers.
	TransportOpts map[string]string
}

TChannelOptions are used to create a TChannel transport.

type Transport

type Transport interface {
	Call(ctx context.Context, request *Request) (*Response, error)
}

Transport defines the interface for the underlying transport over which calls are made.

func HTTP

func HTTP(opts HTTPOptions) (Transport, error)

HTTP returns a transport that calls a HTTP service.

func TChannel

func TChannel(opts TChannelOptions) (Transport, error)

TChannel returns a Transport that calls a TChannel service.

Jump to

Keyboard shortcuts

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