Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alist-org
GitHub Repository: alist-org/alist
Path: blob/main/drivers/ipfs_api/meta.go
1987 views
1
package ipfs
2
3
import (
4
"github.com/alist-org/alist/v3/internal/driver"
5
"github.com/alist-org/alist/v3/internal/op"
6
)
7
8
type Addition struct {
9
// Usually one of two
10
driver.RootPath
11
Mode string `json:"mode" options:"ipfs,ipns,mfs" type:"select" required:"true"`
12
Endpoint string `json:"endpoint" default:"http://127.0.0.1:5001" required:"true"`
13
Gateway string `json:"gateway" default:"http://127.0.0.1:8080" required:"true"`
14
}
15
16
var config = driver.Config{
17
Name: "IPFS API",
18
DefaultRoot: "/",
19
LocalSort: true,
20
OnlyProxy: false,
21
}
22
23
func init() {
24
op.RegisterDriver(func() driver.Driver {
25
return &IPFS{}
26
})
27
}
28
29