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

Commit

Permalink
add support for pinning mfs (#116)
Browse files Browse the repository at this point in the history
* add support for pinning mfs
* add pin conceal selector
* add RemoteServicesPath

Co-authored-by: Petar Maymounkov <petarm@gmail.com>
  • Loading branch information
aschmahmann and petar committed Jan 28, 2021
1 parent 1a8f582 commit 6b35ac3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
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
}

0 comments on commit 6b35ac3

Please sign in to comment.