Skip to content

Commit

Permalink
polish(node): define settings opts for 3rd party dep injection
Browse files Browse the repository at this point in the history
- motivating use case running a lotus-sentinel node
  • Loading branch information
frrist authored and aarshkshah1992 committed Mar 26, 2021
1 parent 8af3a12 commit cc4d778
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions node/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,3 +729,19 @@ func Test() Option {
Override(new(*storageadapter.DealPublisher), storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{})),
)
}

// For 3rd party dep injection.

func WithRepoType(repoType repo.RepoType) func(s *Settings) error {
return func(s *Settings) error {
s.nodeType = repoType
return nil
}
}

func WithInvokesKey(i invoke, resApi interface{}) func(s *Settings) error {
return func(s *Settings) error {
s.invokes[i] = fx.Populate(resApi)
return nil
}
}

0 comments on commit cc4d778

Please sign in to comment.