Skip to content

Commit

Permalink
plugin: Changed loader to use Context instead of BuildCfg
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Kacper Łukawski <[email protected]>
  • Loading branch information
PlayerWithoutName committed Mar 25, 2018
1 parent 0b049c0 commit aea981a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/ipfs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func mainRet() int {
ConfigRoot: repoPath,
LoadConfig: loadConfig,
ReqLog: &oldcmds.ReqLog{},
Plugins: plugins,
ConstructNode: func() (n *core.IpfsNode, err error) {
if req == nil {
return nil, errors.New("constructing node without a request")
Expand All @@ -162,8 +163,7 @@ func mainRet() int {
// ok everything is good. set it on the invocation (for ownership)
// and return it.
n, err = core.NewNode(ctx, &core.BuildCfg{
Repo: r,
Plugins: plugins,
Repo: r,
})
if err != nil {
return nil, err
Expand Down
6 changes: 4 additions & 2 deletions commands/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"strings"
"time"

"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/repo/config"
core "github.com/ipfs/go-ipfs/core"
loader "github.com/ipfs/go-ipfs/plugin/loader"
config "github.com/ipfs/go-ipfs/repo/config"

"gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit"
"gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit/files"
Expand All @@ -18,6 +19,7 @@ type Context struct {
Online bool
ConfigRoot string
ReqLog *ReqLog
Plugins *loader.PluginLoader

config *config.Config
LoadConfig func(path string) (*config.Config, error)
Expand Down
2 changes: 0 additions & 2 deletions core/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
dag "github.com/ipfs/go-ipfs/merkledag"
resolver "github.com/ipfs/go-ipfs/path/resolver"
pin "github.com/ipfs/go-ipfs/pin"
loader "github.com/ipfs/go-ipfs/plugin/loader"
repo "github.com/ipfs/go-ipfs/repo"
cfg "github.com/ipfs/go-ipfs/repo/config"
"github.com/ipfs/go-ipfs/thirdparty/verifbs"
Expand Down Expand Up @@ -49,7 +48,6 @@ type BuildCfg struct {
Routing RoutingOption
Host HostOption
Repo repo.Repo
Plugins *loader.PluginLoader
}

func (cfg *BuildCfg) getOpt(key string) bool {
Expand Down

0 comments on commit aea981a

Please sign in to comment.