Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

add support for pinning mfs #116

Merged
merged 10 commits into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func InitWithIdentity(identity Identity) (*Config, error) {
Type: "basic",
},
},
Pinning: Pinning{
RemoteServices: map[string]RemotePinningService{},
},
}

return conf, nil
Expand Down
25 changes: 19 additions & 6 deletions remotepin.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
package config

const (
PinningTag = "Pinning"
RemoteServicesTag = "RemoteServices"
RemoteServicesSelector = PinningTag + "." + RemoteServicesTag
var (
RemoteServicesPath = "Pinning.RemoteServices"
PinningConcealSelector = []string{"Pinning", "RemoteServices", "*", "API", "Key"}
)

type Pinning struct {
RemoteServices map[string]RemotePinningService
}

type RemotePinningService struct {
Api RemotePinningServiceApi
API RemotePinningServiceAPI
Policies RemotePinningServicePolicies
}

type RemotePinningServiceApi struct {
type RemotePinningServiceAPI struct {
Endpoint string
Key string
}

type RemotePinningServicePolicies struct {
MFS RemotePinningServiceMFSPolicy
}

type RemotePinningServiceMFSPolicy struct {
// Enable enables watching for changes in MFS and re-pinning the MFS root cid whenever a change occurs.
Enable bool
// Name is the pin name for MFS.
PinName string
// RepinInterval determines the repin interval when the policy is enabled. In ns, us, ms, s, m, h.
RepinInterval string
}