gateway

package
v0.0.0-...-7407870 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IpfsPathPrefix = "/ipfs/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayConfig

type GatewayConfig struct {
	Headers      map[string][]string
	Writable     bool
	PathPrefixes []string
}

type GatewayHandler

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

gatewayHandler is a HTTP handler that serves IPFS objects (accessible by default at /ipfs/<path>) (it serves requests like GET /ipfs/QmVRzPKPzNtSrEzBFm2UZfxmPAgnaLke4DMcerbsGGSaFe/link)

func NewGatewayHandler

func NewGatewayHandler(c GatewayConfig, peer Peer, dag ipld.DAGService) *GatewayHandler

func (*GatewayHandler) ResolvePath

func (i *GatewayHandler) ResolvePath(ctx context.Context, p ipath.Path) (ipath.Resolved, error)

func (*GatewayHandler) ServeHTTP

func (i *GatewayHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Peer

type Peer interface {
	Get(context.Context, cid.Cid) (ipld.Node, error)
}

Jump to

Keyboard shortcuts

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