diff --git a/commands/request.go b/commands/request.go index 0962e00809ac3acfa0bd4237b908aa99c38897d2..b05c165501eaa79783cb4e46f3180d23b3e596c9 100644 --- a/commands/request.go +++ b/commands/request.go @@ -65,7 +65,7 @@ func (c *Context) NodeWithoutConstructing() *core.IpfsNode { return c.node } -// RootContext returns the node's context. +// Context returns the node's context. func (c *Context) Context() context.Context { n, err := c.GetNode() if err != nil { diff --git a/core/commands/env.go b/core/commands/env.go index 42fad0ecc41e3d978f16376a379cfaa6f3e1015a..d884292e3e90718871eb17d0541ead4c24f7adcb 100644 --- a/core/commands/env.go +++ b/core/commands/env.go @@ -8,6 +8,7 @@ import ( "github.com/ipfs/go-ipfs/repo/config" ) +// GetNode extracts the node from the environment. func GetNode(env interface{}) (*core.IpfsNode, error) { ctx, ok := env.(*commands.Context) if !ok { @@ -17,6 +18,7 @@ func GetNode(env interface{}) (*core.IpfsNode, error) { return ctx.GetNode() } +// GetConfig extracts the config from the environment. func GetConfig(env interface{}) (*config.Config, error) { ctx, ok := env.(*commands.Context) if !ok { diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index 5ab953ecb8531d56afeaa1497786437bfb816d1a..b9d2efa888fe4d3efa7ef27d80a24d74e258685e 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -37,6 +37,7 @@ or ipfs daemon --api-http-header 'Access-Control-Allow-Origin: *' ` +// APIPath is the path at which the API is mounted. const APIPath = "/api/v0" var defaultLocalhostOrigins = []string{