Documentation
¶
Index ¶
- Variables
- type AuthBlock
- type AuthBlockImpl
- type AuthBlockstore
- type AuthedBlockstore
- func (bs *AuthedBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (bs *AuthedBlockstore) DeleteBlock(c cid.Cid) error
- func (bs *AuthedBlockstore) Get(c cid.Cid, remote peer.ID, auth string) (blocks.Block, error)
- func (bs *AuthedBlockstore) GetSize(c cid.Cid) (int, error)
- func (bs *AuthedBlockstore) Has(c cid.Cid) (bool, error)
- func (bs *AuthedBlockstore) HashOnRead(enabled bool)
- func (bs *AuthedBlockstore) Put(b AuthBlock) error
- func (bs *AuthedBlockstore) PutMany(authblocks []AuthBlock) error
- type Set
- type Want
Constants ¶
This section is empty.
Variables ¶
View Source
var Undef = Want{}
Functions ¶
This section is empty.
Types ¶
type AuthBlock ¶
type AuthBlockImpl ¶
type AuthBlockImpl struct {
// contains filtered or unexported fields
}
func (AuthBlockImpl) Cid ¶
func (a AuthBlockImpl) Cid() cid.Cid
func (AuthBlockImpl) GetAuthedData ¶
func (a AuthBlockImpl) GetAuthedData() []byte
func (AuthBlockImpl) Loggable ¶
func (a AuthBlockImpl) Loggable() map[string]interface{}
func (AuthBlockImpl) Size ¶
func (a AuthBlockImpl) Size() int
func (AuthBlockImpl) Want ¶
func (a AuthBlockImpl) Want() Want
type AuthBlockstore ¶
type AuthBlockstore interface { DeleteBlock(cid.Cid) error Has(cid.Cid) (bool, error) Get(cid.Cid, peer.ID, string) (blocks.Block, error) // GetSize returns the CIDs mapped BlockSize GetSize(cid.Cid) (int, error) // Put puts a given block to the underlying datastore Put(AuthBlock) error // PutMany puts a slice of blocks at the same time using batching // capabilities of the underlying datastore whenever possible. PutMany([]AuthBlock) error // AllKeysChan returns a channel from which // the CIDs in the Blockstore can be read. It should respect // the given context, closing the channel if it becomes Done. AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) // HashOnRead specifies if every read block should be // rehashed to make sure it matches its CID. HashOnRead(enabled bool) }
func NewAuthBlockstore ¶
func NewAuthBlockstore(bstore blockstore.Blockstore, allow func(cid.Cid, peer.ID, string) bool) AuthBlockstore
type AuthedBlockstore ¶
type AuthedBlockstore struct { AuthBlockstore // contains filtered or unexported fields }
func (*AuthedBlockstore) AllKeysChan ¶
func (*AuthedBlockstore) DeleteBlock ¶
func (bs *AuthedBlockstore) DeleteBlock(c cid.Cid) error
func (*AuthedBlockstore) HashOnRead ¶
func (bs *AuthedBlockstore) HashOnRead(enabled bool)
func (*AuthedBlockstore) Put ¶
func (bs *AuthedBlockstore) Put(b AuthBlock) error
func (*AuthedBlockstore) PutMany ¶
func (bs *AuthedBlockstore) PutMany(authblocks []AuthBlock) error
Click to show internal directories.
Click to hide internal directories.