From 34b6da7f0cc51468b34f9bdaad76b4137870db03 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 9 Jul 2019 21:38:05 +0200 Subject: [PATCH] Make config fields public License: MIT Signed-off-by: Jakub Sztandera --- node/repo/memrepo.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/node/repo/memrepo.go b/node/repo/memrepo.go index 26efdf8e8..de2ace933 100644 --- a/node/repo/memrepo.go +++ b/node/repo/memrepo.go @@ -38,10 +38,10 @@ var _ Repo = &MemRepo{} // MemRepoOptions contains options for memory repo type MemRepoOptions struct { - ds datastore.Datastore - configF func() *config.Root - libp2pKey crypto.PrivKey - wallet interface{} + Ds datastore.Datastore + ConfigF func() *config.Root + Libp2pKey crypto.PrivKey + Wallet interface{} } // NewMemory creates new memory based repo with provided options. @@ -51,27 +51,27 @@ func NewMemory(opts *MemRepoOptions) *MemRepo { if opts == nil { opts = &MemRepoOptions{} } - if opts.configF == nil { - opts.configF = config.Default + if opts.ConfigF == nil { + opts.ConfigF = config.Default } - if opts.ds == nil { - opts.ds = dssync.MutexWrap(datastore.NewMapDatastore()) + if opts.Ds == nil { + opts.Ds = dssync.MutexWrap(datastore.NewMapDatastore()) } - if opts.libp2pKey == nil { + if opts.Libp2pKey == nil { pk, _, err := crypto.GenerateEd25519Key(rand.Reader) if err != nil { panic(err) } - opts.libp2pKey = pk + opts.Libp2pKey = pk } return &MemRepo{ repoLock: make(chan struct{}, 1), - datastore: opts.ds, - configF: opts.configF, - libp2pKey: opts.libp2pKey, - wallet: opts.wallet, + datastore: opts.Ds, + configF: opts.ConfigF, + libp2pKey: opts.Libp2pKey, + wallet: opts.Wallet, } }