contentprovider

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0, MIT Imports: 27 Imported by: 0

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