Documentation ¶
Index ¶
- type ProviderRequestValidator
- func (rv *ProviderRequestValidator) Subscribe(subscriber retrievalmarket.ProviderValidationSubscriber) retrievalmarket.Unsubscribe
- func (rv *ProviderRequestValidator) ValidatePull(_ datatransfer.ChannelID, receiver peer.ID, voucher datamodel.Node, ...) (datatransfer.ValidationResult, error)
- func (rv *ProviderRequestValidator) ValidatePush(_ datatransfer.ChannelID, sender peer.ID, voucher datamodel.Node, ...) (datatransfer.ValidationResult, error)
- func (rv *ProviderRequestValidator) ValidateRestart(_ datatransfer.ChannelID, channelState datatransfer.ChannelState) (datatransfer.ValidationResult, error)
- type ValidationEnvironment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderRequestValidator ¶
type ProviderRequestValidator struct {
// contains filtered or unexported fields
}
ProviderRequestValidator validates incoming requests for the Retrieval Provider
func NewProviderRequestValidator ¶
func NewProviderRequestValidator(env ValidationEnvironment) *ProviderRequestValidator
NewProviderRequestValidator returns a new instance of the ProviderRequestValidator
func (*ProviderRequestValidator) Subscribe ¶ added in v1.25.1
func (rv *ProviderRequestValidator) Subscribe(subscriber retrievalmarket.ProviderValidationSubscriber) retrievalmarket.Unsubscribe
func (*ProviderRequestValidator) ValidatePull ¶
func (rv *ProviderRequestValidator) ValidatePull(_ datatransfer.ChannelID, receiver peer.ID, voucher datamodel.Node, baseCid cid.Cid, selector datamodel.Node) (datatransfer.ValidationResult, error)
ValidatePull validates a pull request received from the peer that will receive data
func (*ProviderRequestValidator) ValidatePush ¶
func (rv *ProviderRequestValidator) ValidatePush(_ datatransfer.ChannelID, sender peer.ID, voucher datamodel.Node, baseCid cid.Cid, selector datamodel.Node) (datatransfer.ValidationResult, error)
ValidatePush validates a push request received from the peer that will send data
func (*ProviderRequestValidator) ValidateRestart ¶ added in v1.28.0
func (rv *ProviderRequestValidator) ValidateRestart(_ datatransfer.ChannelID, channelState datatransfer.ChannelState) (datatransfer.ValidationResult, error)
ValidateRestart validates a request on restart, based on its current state
type ValidationEnvironment ¶
type ValidationEnvironment interface { GetAsk(ctx context.Context, payloadCid cid.Cid, pieceCid *cid.Cid, piece piecestore.PieceInfo, isUnsealed bool, client peer.ID) (rm.Ask, error) GetPiece(c cid.Cid, pieceCID *cid.Cid) (piecestore.PieceInfo, bool, error) // CheckDealParams verifies the given deal params are acceptable CheckDealParams(ask rm.Ask, pricePerByte abi.TokenAmount, paymentInterval uint64, paymentIntervalIncrease uint64, unsealPrice abi.TokenAmount) error // RunDealDecisioningLogic runs custom deal decision logic to decide if a deal is accepted, if present RunDealDecisioningLogic(ctx context.Context, state rm.ProviderDealState) (bool, string, error) // StateMachines returns the FSM Group to begin tracking with BeginTracking(pds rm.ProviderDealState) error Get(dealID rm.ProviderDealIdentifier) (rm.ProviderDealState, error) }
ValidationEnvironment contains the dependencies needed to validate deals
Click to show internal directories.
Click to hide internal directories.