Documentation ¶
Overview ¶
Package rest implements an IPFS Cluster API component. It provides a REST-ish API to interact with Cluster.
The implented API is based on the common.API component (refer to module description there). The only thing this module does is to provide route handling for the otherwise common API component.
Index ¶
Constants ¶
View Source
const ( DefaultReadTimeout = 0 DefaultReadHeaderTimeout = 5 * time.Second DefaultWriteTimeout = 0 DefaultIdleTimeout = 120 * time.Second DefaultMaxHeaderBytes = minMaxHeaderBytes )
Default values for Config.
Variables ¶
View Source
var ( // DefaultHTTPListenAddrs contains default listen addresses for the HTTP API. DefaultHTTPListenAddrs = []string{"/ip4/127.0.0.1/tcp/9094"} DefaultHeaders = map[string][]string{} )
Default values for Config.
View Source
var ( DefaultCORSAllowedOrigins = []string{"*"} DefaultCORSAllowedMethods = []string{ http.MethodGet, } // rs/cors this will set sensible defaults when empty: // {"Origin", "Accept", "Content-Type", "X-Requested-With"} DefaultCORSAllowedHeaders = []string{} DefaultCORSExposedHeaders = []string{ "Content-Type", "X-Stream-Output", "X-Chunked-Output", "X-Content-Length", } DefaultCORSAllowCredentials = true DefaultCORSMaxAge time.Duration // 0. Means always. )
CORS defaults.
Functions ¶
This section is empty.
Types ¶
type API ¶
API implements the REST API Component. It embeds a common.API.
type Config ¶
Config fully implements the config.ComponentConfig interface. Use NewConfig() to instantiate. Config embeds a common.Config object.
func NewConfig ¶ added in v0.14.2
func NewConfig() *Config
NewConfig creates a Config object setting the necessary meta-fields in the common.Config embedded object.
Click to show internal directories.
Click to hide internal directories.