sessions

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RssInitStatus                            = "init"
	RssSubmitStatus                          = "submit"
	RssSubmitBalanceReqSignedStatus          = "submit:check-balance-req-singed"
	RssSubmitLedgerChannelCommitSignedStatus = "submit:ledger-channel-commit-signed"
	RssPayStatus                             = "pay"
	RssPayPayinRequestSignedStatus           = "pay:payin-req-signed"
	RssGuardStatus                           = "guard"
	RssGuardFileMetaSignedStatus             = "guard:file-meta-signed"
	RssGuardQuestionsSignedStatus            = "guard:questions-signed"
	RssWaitUploadStatus                      = "wait-upload"
	RssWaitUploadReqSignedStatus             = "wait-upload:req-signed"
	RssCompleteStatus                        = "complete"
	RssErrorStatus                           = "error"

	RssToSubmitEvent                          = "to-submit-event"
	RssToSubmitBalanceReqSignedEvent          = "to-submit:balance-req-signed-event"
	RssToSubmitLedgerChannelCommitSignedEvent = "to-submit:ledger-channel-commit-signed-event"
	RssToPayEvent                             = "to-pay-event"
	RssToPayPayinRequestSignedEvent           = "to-pay:payin-req-signed-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"
	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 Batch

func Batch(d ds.Datastore, keys []string, vals []proto.Message) error

func DeleteShardsContracts

func DeleteShardsContracts(d datastore.Datastore, peerId string, role string) error

func Get

func Get(d ds.Datastore, key string, m proto.Message) error

func GetShardId

func GetShardId(ssId string, shardHash string, index int) (contractId string)

func List

func List(d ds.Datastore, prefix string, substrInKey ...string) ([][]byte, error)

func ListKeys

func ListKeys(d ds.Datastore, prefix string, substrInKey ...string) ([]string, error)

func ListShardsContracts

func ListShardsContracts(d datastore.Datastore, peerId string, role string) ([]*shardpb.SignedContracts, error)

func Remove

func Remove(d ds.Datastore, key string) error

func Save

func Save(d ds.Datastore, key string, val proto.Message) 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 GetHostShard(ctxParams *uh.ContextParams, contractId string) (*HostShard, error)

func (*HostShard) Complete

func (hs *HostShard) Complete() error

func (*HostShard) Contract

func (hs *HostShard) Contract(signedEscrowContract []byte, signedGuardContract *guardpb.Contract) error

type RenterSession

type RenterSession struct {
	PeerId      string
	SsId        string
	Hash        string
	ShardHashes []string

	CtxParams *uh.ContextParams
	Ctx       context.Context
	Cancel    context.CancelFunc
	// contains filtered or unexported fields
}

func GetRenterSession

func GetRenterSession(ctxParams *uh.ContextParams, ssId string, hash string, shardHashes []string) (*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 (*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) Status

func (rs *RenterShard) Status() (*shardpb.Status, error)

func (*RenterShard) UpdateAdditionalInfo

func (rs *RenterShard) UpdateAdditionalInfo(info string) error

Jump to

Keyboard shortcuts

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