blob

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2022 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBlobService

func NewBlobService(
	host host.Host,
	r routing.ContentRouting,
	prefix string,
	ds datastore.Batching,
	metrics module.BitswapMetrics,
	logger zerolog.Logger,
	opts ...network.BlobServiceOption,
) *blobService

NewBlobService creates a new BlobService.

func WithBitswapOptions

func WithBitswapOptions(opts ...bitswap.Option) network.BlobServiceOption

WithBitswapOptions sets additional options for Bitswap exchange

func WithHashOnRead

func WithHashOnRead(enabled bool) network.BlobServiceOption

WithHashOnRead sets whether or not the blobstore will rehash the blob data on read When set, calls to GetBlob will fail with an error if the hash of the data in storage does not match its CID

func WithRateLimit

func WithRateLimit(r float64, b int) network.BlobServiceOption

WithRateLimit sets a rate limit on reads from the underlying datastore that allows up to r bytes per second and permits bursts of at most b bytes. Note that b should be set to at least the max blob size, otherwise blobs larger than b cannot be read from the blobstore.

func WithReprovideInterval

func WithReprovideInterval(d time.Duration) network.BlobServiceOption

WithReprovideInterval sets the interval at which DHT provider entries are refreshed

Types

type BlobServiceConfig

type BlobServiceConfig struct {
	ReprovideInterval time.Duration    // the interval at which the DHT provider entries are refreshed
	BitswapOptions    []bitswap.Option // options to pass to the Bitswap service
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL