Skip to content

Commit

Permalink
Init using op string
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnavarro committed Jun 29, 2022
1 parent 96af2d7 commit 47aae79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ type OptionalString struct {
value *string
}

// NewOptionalString returns an OptionalString from a string
func NewOptionalString(s string) *OptionalString {
return &OptionalString{value: &s}
}

// WithDefault resolves the integer with the given default.
func (p *OptionalString) WithDefault(defaultValue string) (value string) {
if p == nil || p.value == nil {
Expand Down
3 changes: 1 addition & 2 deletions repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ func initTempNode(ctx context.Context, bootstrap []string, peers []peer.AddrInfo
}

// configure the temporary node
// TODO what to do here
// cfg.Routing.Type = "dhtclient"
cfg.Routing.Type = config.NewOptionalString("dhtclient")

// Disable listening for inbound connections
cfg.Addresses.Gateway = []string{}
Expand Down

0 comments on commit 47aae79

Please sign in to comment.