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: 0

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