Commit 1eec61df authored by Steven Allen's avatar Steven Allen

make code-climate happier

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent 8fcf235b
...@@ -22,6 +22,8 @@ var log = logging.Logger("blockservice") ...@@ -22,6 +22,8 @@ var log = logging.Logger("blockservice")
var ErrNotFound = errors.New("blockservice: key not found") var ErrNotFound = errors.New("blockservice: key not found")
// BlockGetter is the common interface shared between blockservice sessions and
// the blockservice.
type BlockGetter interface { type BlockGetter interface {
// GetBlock gets the requested block. // GetBlock gets the requested block.
GetBlock(ctx context.Context, c *cid.Cid) (blocks.Block, error) GetBlock(ctx context.Context, c *cid.Cid) (blocks.Block, error)
...@@ -95,12 +97,14 @@ func NewWriteThrough(bs blockstore.Blockstore, rem exchange.Interface) BlockServ ...@@ -95,12 +97,14 @@ func NewWriteThrough(bs blockstore.Blockstore, rem exchange.Interface) BlockServ
} }
} }
func (bs *blockService) Blockstore() blockstore.Blockstore { // Blockstore returns the blockstore behind this blockservice.
return bs.blockstore func (s *blockService) Blockstore() blockstore.Blockstore {
return s.blockstore
} }
func (bs *blockService) Exchange() exchange.Interface { // Exchange returns the exchange behind this blockservice.
return bs.exchange func (s *blockService) Exchange() exchange.Interface {
return s.exchange
} }
// NewSession creates a bitswap session that allows for controlled exchange of // NewSession creates a bitswap session that allows for controlled exchange of
...@@ -286,3 +290,5 @@ func (s *Session) GetBlock(ctx context.Context, c *cid.Cid) (blocks.Block, error ...@@ -286,3 +290,5 @@ func (s *Session) GetBlock(ctx context.Context, c *cid.Cid) (blocks.Block, error
func (s *Session) GetBlocks(ctx context.Context, ks []*cid.Cid) <-chan blocks.Block { func (s *Session) GetBlocks(ctx context.Context, ks []*cid.Cid) <-chan blocks.Block {
return getBlocks(ctx, ks, s.bs, s.ses) return getBlocks(ctx, ks, s.bs, s.ses)
} }
var _ BlockGetter = (*Session)(nil)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment