Documentation ¶
Index ¶
- Constants
- func Batch(d ds.Datastore, keys []string, vals []proto.Message) error
- func DeleteShardsContracts(d datastore.Datastore, peerId string, role string) error
- func Get(d ds.Datastore, key string, m proto.Message) error
- func GetShardId(ssId string, shardHash string, index int) (contractId string)
- func List(d ds.Datastore, prefix string, substrInKey ...string) ([][]byte, error)
- func ListKeys(d ds.Datastore, prefix string, substrInKey ...string) ([]string, error)
- func ListShardsContracts(d datastore.Datastore, peerId string, role string) ([]*shardpb.SignedContracts, error)
- func Remove(d ds.Datastore, key string) error
- func Save(d ds.Datastore, key string, val proto.Message) error
- func SaveShardsContracts(ds datastore.Datastore, scs []*shardpb.SignedContracts, ...) ([]*shardpb.SignedContracts, []string, error)
- type HostShard
- func (hs *HostShard) Complete() error
- func (hs *HostShard) Contract(signedEscrowContract []byte, signedGuardContract *guardpb.Contract) error
- func (hs *HostShard) GetInputAmount() int64
- func (hs *HostShard) GetInputPrice() int64
- func (hs *HostShard) GetInputRate() *big.Int
- func (hs *HostShard) IsContractStatus() bool
- func (hs *HostShard) IsPayStatus() bool
- func (hs *HostShard) ReceivePayCheque() error
- type RenterSession
- func (rs *RenterSession) GetAdditionalInfo() (*renterpb.RenterSessionAdditionalInfo, error)
- func (rs *RenterSession) GetCompleteShardsNum() (int, int, error)
- func (rs *RenterSession) OfflineMeta() (*renterpb.OfflineMeta, error)
- func (rs *RenterSession) OfflineSigning() (*renterpb.OfflineSigning, error)
- func (rs *RenterSession) SaveOfflineMeta(meta *renterpb.OfflineMeta) error
- func (rs *RenterSession) SaveOfflineSigning(signingData *renterpb.OfflineSigning) error
- func (rs *RenterSession) Status() (*renterpb.RenterSessionStatus, error)
- func (rs *RenterSession) To(event string, args ...interface{}) error
- func (rs *RenterSession) UpdateAdditionalInfo(info string) error
- type RenterSessionsCursor
- type RenterShard
- func (rs *RenterShard) Contract(signedEscrowContract []byte, signedGuardContract *guardpb.Contract) error
- func (rs *RenterShard) Contracts() (*shardpb.SignedContracts, error)
- func (rs *RenterShard) GetAdditionalInfo() (*shardpb.AdditionalInfo, error)
- func (rs *RenterShard) Status() (*shardpb.Status, error)
- func (rs *RenterShard) UpdateAdditionalInfo(info string) error
Constants ¶
View Source
const ( RssInitStatus = "init" RssSubmitStatus = "submit" RssGuardStatus = "guard" RssGuardFileMetaSignedStatus = "guard:file-meta-signed" RssGuardQuestionsSignedStatus = "guard:questions-signed" RssWaitUploadStatus = "wait-upload" RssWaitUploadReqSignedStatus = "wait-upload:req-signed" RssPayStatus = "pay" RssCompleteStatus = "complete" RssErrorStatus = "error" RssToSubmitEvent = "to-submit-event" RssToGuardEvent = "to-guard-event" RssToGuardFileMetaSignedEvent = "to-guard:file-meta-signed-event" RssToGuardQuestionsSignedEvent = "to-guard:questions-signed-event" RssToWaitUploadEvent = "to-wait-upload-event" RssToWaitUploadReqSignedEvent = "to-wait-upload-signed-event" RssToPayEvent = "to-pay-event" RssToCompleteEvent = "to-complete-event" RssToErrorEvent = "to-error-event" RenterSessionPrefix = "/btfs/%s/renter/sessions/" RenterSessionKey = RenterSessionPrefix + "%s/" RenterSessionInMemKey = RenterSessionKey RenterSessionStatusKey = RenterSessionKey + "status" RenterSessionAdditionalInfoKey = RenterSessionKey + "additional-info" RenterSessionOfflineMetaKey = RenterSessionKey + "offline-meta" RenterSessionOfflineSigningKey = RenterSessionKey + "offline-signing" )
Variables ¶
This section is empty.
Functions ¶
func DeleteShardsContracts ¶
func ListShardsContracts ¶
func ListShardsContracts(d datastore.Datastore, peerId string, role string) ([]*shardpb.SignedContracts, error)
func SaveShardsContracts ¶
func SaveShardsContracts(ds datastore.Datastore, scs []*shardpb.SignedContracts, gcs []*guardpb.Contract, peerID, role string) ([]*shardpb.SignedContracts, []string, error)
SaveShardsContracts persists updated guard contracts from upstream, if an existing entry is not available, then an empty signed escrow contract is inserted along with the new guard contract.
Types ¶
type HostShard ¶
type HostShard struct {
// contains filtered or unexported fields
}
func GetHostShard ¶
func (*HostShard) GetInputAmount ¶
func (*HostShard) GetInputPrice ¶
func (*HostShard) GetInputRate ¶
func (*HostShard) IsContractStatus ¶
func (*HostShard) IsPayStatus ¶
func (*HostShard) ReceivePayCheque ¶
type RenterSession ¶
type RenterSession struct { PeerId string SsId string Hash string ShardHashes []string CtxParams *uh.ContextParams Ctx context.Context Cancel context.CancelFunc Token common.Address // contains filtered or unexported fields }
func GetRenterSession ¶
func GetRenterSession(ctxParams *uh.ContextParams, ssId string, hash string, shardHashes []string) (*RenterSession, error)
func GetRenterSessionWithToken ¶
func GetRenterSessionWithToken(ctxParams *uh.ContextParams, ssId string, hash string, shardHashes []string, token common.Address) (*RenterSession, error)
func (*RenterSession) GetAdditionalInfo ¶
func (rs *RenterSession) GetAdditionalInfo() (*renterpb.RenterSessionAdditionalInfo, error)
func (*RenterSession) GetCompleteShardsNum ¶
func (rs *RenterSession) GetCompleteShardsNum() (int, int, error)
func (*RenterSession) OfflineMeta ¶
func (rs *RenterSession) OfflineMeta() (*renterpb.OfflineMeta, error)
func (*RenterSession) OfflineSigning ¶
func (rs *RenterSession) OfflineSigning() (*renterpb.OfflineSigning, error)
func (*RenterSession) SaveOfflineMeta ¶
func (rs *RenterSession) SaveOfflineMeta(meta *renterpb.OfflineMeta) error
func (*RenterSession) SaveOfflineSigning ¶
func (rs *RenterSession) SaveOfflineSigning(signingData *renterpb.OfflineSigning) error
func (*RenterSession) Status ¶
func (rs *RenterSession) Status() (*renterpb.RenterSessionStatus, error)
func (*RenterSession) To ¶
func (rs *RenterSession) To(event string, args ...interface{}) error
func (*RenterSession) UpdateAdditionalInfo ¶
func (rs *RenterSession) UpdateAdditionalInfo(info string) error
type RenterSessionsCursor ¶
type RenterSessionsCursor struct {
// contains filtered or unexported fields
}
func GetRenterSessionsCursor ¶
func GetRenterSessionsCursor(ctxParam *uh.ContextParams) (*RenterSessionsCursor, error)
func (*RenterSessionsCursor) NextSession ¶
func (r *RenterSessionsCursor) NextSession(status string) (*RenterSession, error)
type RenterShard ¶
type RenterShard struct {
// contains filtered or unexported fields
}
func GetRenterShard ¶
func GetRenterShard(ctxParams *uh.ContextParams, ssId string, hash string, index int) (*RenterShard, error)
func (*RenterShard) Contract ¶
func (rs *RenterShard) Contract(signedEscrowContract []byte, signedGuardContract *guardpb.Contract) error
func (*RenterShard) Contracts ¶
func (rs *RenterShard) Contracts() (*shardpb.SignedContracts, error)
func (*RenterShard) GetAdditionalInfo ¶
func (rs *RenterShard) GetAdditionalInfo() (*shardpb.AdditionalInfo, error)
func (*RenterShard) UpdateAdditionalInfo ¶
func (rs *RenterShard) UpdateAdditionalInfo(info string) error
Click to show internal directories.
Click to hide internal directories.