restapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2017 License: MIT Imports: 17 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 = 30 * time.Second
	// maximum duration before timing out write of the response
	RESTAPIServerWriteTimeout = 60 * time.Second
	// server-side the amount of time a Keep-Alive connection will be
	// kept idle before being reused
	RESTAPIServerIdleTimeout = 120 * 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 NewTLSRESTAPI added in v0.1.0

func NewTLSRESTAPI(apiMAddr ma.Multiaddr, tlsCfg *tls.Config) (*RESTAPI, error)

NewTlsRESTAPI creates a new REST API component that uses TLS for security (authentication, encryption). It receives the multiaddress on which the API listens, as well as paths to certificate and private key files

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