service

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: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddr string

	PostgresURI string

	IPFSAPIMultiaddr string

	DealDuration         uint64
	DealReplication      uint32
	DefaultWalletAddress string
	VerifiedDeals        bool

	AuctionMaxRetries            int
	DefaultBatchDeadlineDuration time.Duration
	DefaultProposalStartOffset   time.Duration
}

Config provides configuration to the broker service.

type Service

type Service struct {
	pb.UnimplementedAPIServiceServer
	// contains filtered or unexported fields
}

Service provides an implementation of the broker API.

func New

func New(mb msgbroker.MsgBroker, config Config) (*Service, error)

New returns a new Service.

func (*Service) Close

func (s *Service) Close() error

Close gracefully closes the service.

func (*Service) CreatePreparedStorageRequest

CreatePreparedStorageRequest creates a new prepared StorageRequest.

func (*Service) CreateStorageRequest

CreateStorageRequest creates a new StorageRequest.

func (*Service) GetStorageRequestInfo

GetStorageRequestInfo gets information about a storage request by id.

func (*Service) OnAuctionClosed

func (s *Service) OnAuctionClosed(ctx context.Context, opID msgbroker.OperationID, au broker.ClosedAuction) error

OnAuctionClosed handles new messages in auction-closed topic.

func (*Service) OnFinalizedDeal

func (s *Service) OnFinalizedDeal(ctx context.Context, opID msgbroker.OperationID, fd broker.FinalizedDeal) error

OnFinalizedDeal handles new messages in the finalized-deal topic.

func (*Service) OnNewBatchCreated

func (s *Service) OnNewBatchCreated(
	ctx context.Context,
	id broker.BatchID,
	batchCid cid.Cid,
	batchSize int64,
	brids []broker.StorageRequestID,
	origin string,
	manifest []byte,
	carURL *url.URL) error

OnNewBatchCreated handles new messages in new-batch-created topic.

func (*Service) OnNewBatchPrepared

func (s *Service) OnNewBatchPrepared(
	ctx context.Context,
	id broker.BatchID,
	pr broker.DataPreparationResult) error

OnNewBatchPrepared handles new messages in new-batch-prepared topic.

Jump to

Keyboard shortcuts

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