Documentation ¶
Index ¶
- type BrokerStorage
- func (bs *BrokerStorage) CreateFromExternalSource(ctx context.Context, adr storage.AuctionDataRequest, origin string) (storage.Request, error)
- func (bs *BrokerStorage) CreateFromReader(ctx context.Context, or io.Reader, origin string) (storage.Request, error)
- func (bs *BrokerStorage) GetCAR(ctx context.Context, c cid.Cid, w io.Writer) (bool, error)
- func (bs *BrokerStorage) GetCARHeader(ctx context.Context, c cid.Cid, w io.Writer) (bool, error)
- func (bs *BrokerStorage) GetRequestInfo(ctx context.Context, id string) (storage.RequestInfo, error)
- func (bs *BrokerStorage) IsAuthorized(ctx context.Context, identity string) (auth.AuthorizedEntity, bool, string, error)
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 ¶
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 ¶
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.