forked from ipfs/kubo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for pinning mfs (ipfs#116)
* add support for pinning mfs * add pin conceal selector * add RemoteServicesPath Co-authored-by: Petar Maymounkov <[email protected]>
- Loading branch information
1 parent
2adefb4
commit 249481b
Showing
2 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |