diff --git a/config/init.go b/config/init.go index 448fffa73c1b..ecda3047ddbe 100644 --- a/config/init.go +++ b/config/init.go @@ -86,6 +86,9 @@ func InitWithIdentity(identity Identity) (*Config, error) { Type: "basic", }, }, + Pinning: Pinning{ + RemoteServices: map[string]RemotePinningService{}, + }, } return conf, nil diff --git a/config/remotepin.go b/config/remotepin.go index 9da2af1bf0b4..135aa664d174 100644 --- a/config/remotepin.go +++ b/config/remotepin.go @@ -1,9 +1,8 @@ package config -const ( - PinningTag = "Pinning" - RemoteServicesTag = "RemoteServices" - RemoteServicesSelector = PinningTag + "." + RemoteServicesTag +var ( + RemoteServicesPath = "Pinning.RemoteServices" + PinningConcealSelector = []string{"Pinning", "RemoteServices", "*", "API", "Key"} ) type Pinning struct { @@ -11,10 +10,24 @@ type Pinning struct { } 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 +}