httprest

package
v0.0.0-...-d85aa1e Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRESTHandler

CreateRESTHandler creates handlers for the API Leave cc nil unless you need to be able to create a specialized context, e.g. GAE logger can be nil - set for debug

func StartServer

StartServer starts an HTTP REST server given a service. Normally this service is an instance of LocalService.

Types

type Client

type Client struct {
	// BaseURL is the URL (with no trailing slash) of the server, e.g. http://localhost:8081
	BaseURL string

	// HTTPClient is the client to use for sending requests.
	HTTPClient *http.Client
}

Client provides a way to access the API over HTTP REST. Where possible it is suggested that the grpc.Client be used in preference.

func (*Client) Dial

Dial returns a server object read to speak with directly or wrap.

func (*Client) MustDial

MustDial is a convenience method that exits with a fatal error if the operation fails

type ContextCreator

type ContextCreator func(*http.Request) context.Context

ContextCreator is a function that can produce a context object based on a request. If not specified, a background context will be used.

Jump to

Keyboard shortcuts

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