Documentation ¶
Index ¶
Constants ¶
const ( IpfsPathPrefix = "/ipfs/" IpnsPathPrefix = "/ipns/" )
const WebUIPath = "/ipfs/QmXX7YRpU7nNBKfw75VG7Y1c3GwpSAGHRev67XVPgZFv9R"
TODO: move to IPNS
Variables ¶
var WebUIOption = RedirectOption("webui", WebUIPath)
var WebUIPaths = []string{ WebUIPath, "/ipfs/QmXdu7HWdV6CUaUabd9q2ZeA4iHZLVyDRj3Gi4dsJsWjbr", "/ipfs/QmaaqrHyAQm7gALkRW8DcfGX3u8q9rWKnxEMmf7m9z515w", "/ipfs/QmSHDxWsMPuJQKWmVA1rB5a3NX2Eme5fPqNb63qwaqiqSp", "/ipfs/QmctngrQAt9fjpQUZr7Bx3BsXUcif52eZGTizWhvcShsjz", }
this is a list of all past webUI paths.
Functions ¶
func ListenAndServe ¶
func ListenAndServe(n *core.IpfsNode, listeningMultiAddr string, options ...ServeOption) error
ListenAndServe runs an HTTP server listening at |listeningMultiAddr| with the given serve options. The address must be provided in multiaddr format.
TODO intelligently parse address strings in other formats so long as they unambiguously map to a valid multiaddr. e.g. for convenience, ":8080" should map to "/ip4/0.0.0.0/tcp/8080".
func NewDagEmptyDir ¶
Types ¶
type BlockList ¶
type BlockList struct { Decider Decider // contains filtered or unexported fields }
func (*BlockList) SetDecider ¶
SetDecider atomically swaps the blocklist's decider. This method is thread-safe.
func (*BlockList) ShouldAllow ¶
func (*BlockList) ShouldBlock ¶
type Gateway ¶
type Gateway struct {
Config GatewayConfig
}
Gateway should be instantiated using NewGateway
func NewGateway ¶
func NewGateway(conf GatewayConfig) *Gateway
func (*Gateway) ServeOption ¶
func (g *Gateway) ServeOption() ServeOption
type GatewayConfig ¶
type ServeOption ¶
ServeOption registers any HTTP handlers it provides on the given mux. It returns the mux to expose to future options, which may be a new mux if it is interested in mediating requests to future options, or the same mux initially passed in if not.
func CommandsOption ¶
func CommandsOption(cctx commands.Context) ServeOption
func GatewayOption ¶
func GatewayOption(writable bool) ServeOption
func IPNSHostnameOption ¶
func IPNSHostnameOption() ServeOption
IPNSHostnameOption rewrites an incoming request if its Host: header contains an IPNS name. The rewritten request points at the resolved name on the gateway handler.
func RedirectOption ¶
func RedirectOption(path string, redirect string) ServeOption
func VersionOption ¶
func VersionOption() ServeOption