contentprovider

package
v0.2.43 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0, MIT Imports: 27 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

This section is empty.

Functions

func GenerateNewPeer

func GenerateNewPeer() ([]byte, []byte, peer.ID, error)

func GetMetadataHandler

func GetMetadataHandler(c echo.Context, db *gorm.DB) error

Types

type ContentProviderConfig

type ContentProviderConfig struct {
	EnableHTTP        bool
	HTTPBind          string
	EnableBitswap     bool
	Libp2pIdentityKey string
	Libp2pListenAddrs []string
}

type ContentProviderService

type ContentProviderService struct {
	Resolver datasource.HandlerResolver
	DB       *gorm.DB
	// contains filtered or unexported fields
}

func NewContentProviderService

func NewContentProviderService(db *gorm.DB, config ContentProviderConfig) (*ContentProviderService, error)

func (*ContentProviderService) FindPiece

func (s *ContentProviderService) FindPiece(ctx context.Context, pieceCid cid.Cid) (
	io.ReadSeekCloser,
	time.Time,
	error,
)

func (*ContentProviderService) GetMetadataHandler

func (s *ContentProviderService) GetMetadataHandler(c echo.Context) error

func (*ContentProviderService) GetPieceMetadata

func (s *ContentProviderService) GetPieceMetadata(ctx context.Context, car model.Car) (*PieceMetadata, error)

func (*ContentProviderService) Start

func (*ContentProviderService) StartBitswap

func (s *ContentProviderService) StartBitswap(ctx context.Context) error

type PieceMetadata

type PieceMetadata struct {
	Car       model.Car        `json:"car"`
	Source    model.Source     `json:"source"`
	CarBlocks []model.CarBlock `json:"carBlocks"`
	Items     []model.Item     `json:"items"`
}

func GetPieceMetadata

func GetPieceMetadata(ctx context.Context, db *gorm.DB, car model.Car) (*PieceMetadata, error)

Jump to

Keyboard shortcuts

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