downloadserver

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0, MIT Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = log.Logger("downloadserver")

Functions

func GetMetadata

func GetMetadata(
	ctx context.Context,
	api string,
	config map[string]string,
	clientConfig model.ClientConfig,
	pieceCid string) (*contentprovider.PieceMetadata, int, error)

Types

type DownloadServer

type DownloadServer struct {
	// contains filtered or unexported fields
}

func NewDownloadServer

func NewDownloadServer(bind string, api string, config map[string]string, clientConfig model.ClientConfig) *DownloadServer

func (*DownloadServer) Name

func (d *DownloadServer) Name() string

func (*DownloadServer) Start

func (d *DownloadServer) Start(ctx context.Context, exitErr chan<- error) error

type UsageCache

type UsageCache[C any] struct {
	// contains filtered or unexported fields
}

func NewUsageCache

func NewUsageCache[C any](ttl time.Duration) *UsageCache[C]

func (*UsageCache[C]) Close

func (c *UsageCache[C]) Close()

func (*UsageCache[C]) Done

func (c *UsageCache[C]) Done(key string)

func (*UsageCache[C]) Get

func (c *UsageCache[C]) Get(key string) (*C, bool)

func (*UsageCache[C]) Set

func (c *UsageCache[C]) Set(key string, item C)

Jump to

Keyboard shortcuts

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