2023-05-05 17:42:22 +08:00
|
|
|
package ipfs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/alist-org/alist/v3/internal/driver"
|
|
|
|
"github.com/alist-org/alist/v3/internal/op"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Addition struct {
|
|
|
|
// Usually one of two
|
|
|
|
driver.RootPath
|
2025-03-27 23:25:23 +08:00
|
|
|
Mode string `json:"mode" options:"ipfs,ipns,mfs" type:"select" required:"true"`
|
2025-04-12 17:01:30 +08:00
|
|
|
Endpoint string `json:"endpoint" default:"http://127.0.0.1:5001" required:"true"`
|
|
|
|
Gateway string `json:"gateway" default:"http://127.0.0.1:8080" required:"true"`
|
2023-05-05 17:42:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
var config = driver.Config{
|
|
|
|
Name: "IPFS API",
|
|
|
|
DefaultRoot: "/",
|
|
|
|
LocalSort: true,
|
2025-03-27 23:25:23 +08:00
|
|
|
OnlyProxy: false,
|
2023-05-05 17:42:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
op.RegisterDriver(func() driver.Driver {
|
|
|
|
return &IPFS{}
|
|
|
|
})
|
|
|
|
}
|