brokerstorage

package
v0.0.0-...-269d6e4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerStorage

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

BrokerStorage its an API implementation of the storage service.

func New

func New(
	auth auth.Authorizer,
	up uploader.Uploader,
	broker broker.Broker,
	ipfsEndpoints []multiaddr.Multiaddr,
	pinataJWT string,
	host host.Host,
	relayMaddr string,
) (*BrokerStorage, error)

New returns a new BrokerStorage.

func (*BrokerStorage) CreateFromExternalSource

func (bs *BrokerStorage) CreateFromExternalSource(
	ctx context.Context,
	adr storage.AuctionDataRequest,
	origin string,
) (storage.Request, error)

CreateFromExternalSource creates a storage request for prepared data.

func (*BrokerStorage) CreateFromReader

func (bs *BrokerStorage) CreateFromReader(
	ctx context.Context,
	or io.Reader,
	origin string,
) (storage.Request, error)

CreateFromReader creates a StorageRequest using data from a stream.

func (*BrokerStorage) GetCAR

func (bs *BrokerStorage) GetCAR(ctx context.Context, c cid.Cid, w io.Writer) (bool, error)

GetCAR generates a CAR file from the provided Cid and writes it a io.Writer. If the Cid can not be found, it does nothing and returns false without error.

func (*BrokerStorage) GetCARHeader

func (bs *BrokerStorage) GetCARHeader(ctx context.Context, c cid.Cid, w io.Writer) (bool, error)

GetCARHeader generates a CAR header from the provided Cid and writes it to a io.Writer. If the Cid can not be found, it does nothing and returns false without error.

func (*BrokerStorage) GetRequestInfo

func (bs *BrokerStorage) GetRequestInfo(ctx context.Context, id string) (storage.RequestInfo, error)

GetRequestInfo returns information about a request.

func (*BrokerStorage) IsAuthorized

func (bs *BrokerStorage) IsAuthorized(
	ctx context.Context,
	identity string) (auth.AuthorizedEntity, bool, string, error)

IsAuthorized resolves if the provided identity is authorized to use the service. If it isn't authorized, the second return parameter explains the cause.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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