This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config for downloading repo migrations
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package config | ||
|
||
import "github.com/libp2p/go-libp2p-core/peer" | ||
|
||
const DefaultMigrationKeep = "cache" | ||
|
||
var DefaultMigrationDownloadSources = []string{"HTTPS", "IPFS"} | ||
|
||
// Migration configures how migrations are downloaded and if the downloads are | ||
// added to IPFS locally | ||
type Migration struct { | ||
// Sources in order of preference where "HTTPS" means our gateways and | ||
// "IPFS" means over IPFS. Any other values are interpretes as hostnames | ||
// for custom gateways. An empty list means "do the default thing" | ||
DownloadSources []string | ||
// Whether or not to keep the migration after downloading it. | ||
// Options are "discard", "cache", "pin". Empty string for default. | ||
Keep string | ||
// Peers lists the nodes to attempt to connect with when downloading | ||
// migrations. | ||
Peers []peer.AddrInfo | ||
} |