restapi

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package restapi implements an IPFS Cluster API component. It provides a REST-ish API to interact with Cluster over HTTP.

Index

Constants

This section is empty.

Variables

View Source
var (
	// maximum duration before timing out read of the request
	RESTAPIServerReadTimeout = 5 * time.Second
	// maximum duration before timing out write of the response
	RESTAPIServerWriteTimeout = 10 * time.Second
	// server-side the amount of time a Keep-Alive connection will be
	// kept idle before being reused
	RESTAPIServerIdleTimeout = 60 * time.Second
)

Server settings

Functions

This section is empty.

Types

type RESTAPI

type RESTAPI struct {
	// contains filtered or unexported fields
}

RESTAPI implements an API and aims to provides a RESTful HTTP API for Cluster.

func NewRESTAPI

func NewRESTAPI(apiMAddr ma.Multiaddr) (*RESTAPI, error)

NewRESTAPI creates a new REST API component. It receives the multiaddress on which the API listens.

func (*RESTAPI) SetClient

func (rest *RESTAPI) SetClient(c *rpc.Client)

SetClient makes the component ready to perform RPC requests.

func (*RESTAPI) Shutdown

func (rest *RESTAPI) Shutdown() error

Shutdown stops any API listeners.

Jump to

Keyboard shortcuts

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