Documentation ¶
Overview ¶
Package pinsvcapi implements an IPFS Cluster API component which provides an IPFS Pinning Services API to the 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 ¶
const ( DefaultReadTimeout = 0 DefaultReadHeaderTimeout = 5 * time.Second DefaultWriteTimeout = 0 DefaultIdleTimeout = 120 * time.Second DefaultMaxHeaderBytes = minMaxHeaderBytes )
Default values for Config.
Variables ¶
var ( // DefaultHTTPListenAddrs contains default listen addresses for the HTTP API. DefaultHTTPListenAddrs = []string{"/ip4/127.0.0.1/tcp/9097"} DefaultHeaders = map[string][]string{} )
Default values for Config.
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 ¶
func NewConfig() *Config
NewConfig creates a Config object setting the necessary meta-fields in the common.Config embedded object.