Documentation ¶
Index ¶
- Constants
- Variables
- func Activate(ctx context.Context, amount utiltypes.Coin, txFee utiltypes.TxFee) error
- func BackupFileSlice(ctx context.Context, tk *task.UploadSliceTask) error
- func CheckAndSendRetryMessage(ctx context.Context, dTask *task.DownloadTask)
- func CheckTransferTimeout(ctx context.Context) func()
- func ClearExpiredShareLinks(ctx context.Context, walletAddr string, walletPubkey, wsign []byte, ...)
- func ClearFileInfoAndDownloadTask(ctx context.Context, fileHash string, fileReqId string, w http.ResponseWriter)
- func CreateAndSimulateTx(txMsg sdktypes.Msg, msgType string, txFee types.TxFee, memo string, ...) ([]byte, error)
- func Deactivate(ctx context.Context, txFee utiltypes.TxFee) error
- func DeleteFile(ctx context.Context, fileHash string, walletAddr string, ...)
- func DeleteShare(ctx context.Context, shareID, walletAddress string, walletPubkey, wsign []byte, ...)
- func DownloadFileSlices(ctx context.Context, target *protos.RspFileStorageInfo, reqId string)
- func DownloadSliceCancel(ctx context.Context, fileHash, reqID string)
- func DownloadSlicePause(ctx context.Context, fileHash, reqID string)
- func FindFileList(ctx context.Context, fileName string, walletAddr string, pageId uint64, ...)
- func GetAllShareLink(ctx context.Context, walletAddr string, page uint64, ...)
- func GetFilePath(key string) string
- func GetFileReplicaInfo(ctx context.Context, path string, replicaIncreaseNum uint32)
- func GetFileStatus(ctx context.Context, fileHash, walletAddr string, ...) *protos.RspFileStatus
- func GetFileStorageInfo(ctx context.Context, path, savePath, saveAs string, w http.ResponseWriter)
- func GetOngoingDownloadTaskCount() int
- func GetOngoingUploadTaskCount() int
- func GetReqShareFile(ctx context.Context, fileHash, pathHash, walletAddr string, shareTime int64, ...)
- func GetShareFile(ctx context.Context, keyword, sharePassword, saveAs, walletAddr string, ...)
- func GetWalletOz(ctx context.Context, walletAddr, reqId string) error
- func HandleSendPacketCostTime(packetId, costTime int64)
- func NoticeActivatedPP(ctx context.Context, conn core.WriteCloser)
- func NoticeDeactivatedPP(ctx context.Context, conn core.WriteCloser)
- func NoticeFileSliceBackup(ctx context.Context, conn core.WriteCloser)
- func NoticeFileSliceBackupVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func NoticeSpUnderMaintenance(ctx context.Context, conn core.WriteCloser)
- func NoticeUnbondingPP(ctx context.Context, conn core.WriteCloser)
- func NoticeUpdatedDeposit(ctx context.Context, conn core.WriteCloser)
- func PpRspVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func Prepay(ctx context.Context, beneficiary []byte, amount utiltypes.Coin, ...) error
- func RegisterAllEventHandlers()
- func RegisterNewPP(ctx context.Context, walletAddr string, walletPubkey, wsig []byte, ...)
- func ReqBackupFileSlice(ctx context.Context, conn core.WriteCloser)
- func ReqBackupStatus(ctx context.Context, fileHash string)
- func ReqClearDownloadTask(ctx context.Context, conn core.WriteCloser)
- func ReqDownloadSlice(ctx context.Context, conn core.WriteCloser)
- func ReqFileStorageInfo(ctx context.Context, conn core.WriteCloser)
- func ReqGetHDInfo(ctx context.Context, conn core.WriteCloser)
- func ReqGetPPDowngradeInfo(ctx context.Context) error
- func ReqGetWalletOzForDownload(ctx context.Context, walletAddr, reqId string, ...) error
- func ReqGetWalletOzForUpload(ctx context.Context, walletAddr, reqId string, uploadReq *protos.ReqUploadFile) error
- func ReqPpLatencyCheck(ctx context.Context, conn core.WriteCloser)
- func ReqStateChange(ctx context.Context, conn core.WriteCloser)
- func ReqTransferDownload(ctx context.Context, conn core.WriteCloser)
- func ReqUploadFileSlice(ctx context.Context, conn core.WriteCloser)
- func RequestUploadFile(ctx context.Context, path string, isEncrypted, isVideoStream bool, ...)
- func RspActivate(ctx context.Context, conn core.WriteCloser)
- func RspBackupFileSlice(ctx context.Context, conn core.WriteCloser)
- func RspBackupStatus(ctx context.Context, _ core.WriteCloser)
- func RspBackupStatusVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func RspBackupStatusWithNoReqIdVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func RspBadVersion(ctx context.Context, _ core.WriteCloser)
- func RspClearExpiredShareLinks(ctx context.Context, conn core.WriteCloser)
- func RspDeactivate(ctx context.Context, conn core.WriteCloser)
- func RspDeleteFile(ctx context.Context, conn core.WriteCloser)
- func RspDeleteShare(ctx context.Context, conn core.WriteCloser)
- func RspDownloadFileWrong(ctx context.Context, conn core.WriteCloser)
- func RspDownloadSlice(ctx context.Context, conn core.WriteCloser)
- func RspFileReplicaInfo(ctx context.Context, conn core.WriteCloser)
- func RspFileStatus(ctx context.Context, conn core.WriteCloser)
- func RspFileStorageInfo(ctx context.Context, conn core.WriteCloser)
- func RspFileStorageInfoVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func RspFileStorageInfoWithNoReqIdVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func RspFindMyFileList(ctx context.Context, conn core.WriteCloser)
- func RspGetHDInfo(ctx context.Context, conn core.WriteCloser)
- func RspGetPPDowngradeInfo(ctx context.Context, conn core.WriteCloser)
- func RspGetPPList(ctx context.Context, conn core.WriteCloser)
- func RspGetPPStatus(ctx context.Context, conn core.WriteCloser)
- func RspGetSPList(ctx context.Context, conn core.WriteCloser)
- func RspGetShareFile(ctx context.Context, _ core.WriteCloser)
- func RspGetWalletOz(ctx context.Context, conn core.WriteCloser)
- func RspMining(ctx context.Context, conn core.WriteCloser)
- func RspPpLatencyCheck(ctx context.Context, _ core.WriteCloser)
- func RspPrepay(ctx context.Context, conn core.WriteCloser)
- func RspRegister(ctx context.Context, conn core.WriteCloser)
- func RspRegisterNewPP(ctx context.Context, conn core.WriteCloser)
- func RspReportBackupSliceResult(ctx context.Context, conn core.WriteCloser)
- func RspReportDownloadResult(ctx context.Context, conn core.WriteCloser)
- func RspReportNodeStatus(ctx context.Context, conn core.WriteCloser)
- func RspReportUploadSliceResult(ctx context.Context, conn core.WriteCloser)
- func RspShareFile(ctx context.Context, conn core.WriteCloser)
- func RspShareLink(ctx context.Context, conn core.WriteCloser)
- func RspSpLatencyCheck(ctx context.Context, _ core.WriteCloser)
- func RspStartMaintenance(ctx context.Context, _ core.WriteCloser)
- func RspStateChange(ctx context.Context, conn core.WriteCloser)
- func RspStopMaintenance(ctx context.Context, _ core.WriteCloser)
- func RspTransferDownload(ctx context.Context, conn core.WriteCloser)
- func RspTransferDownloadResult(ctx context.Context, conn core.WriteCloser)
- func RspUpdateDeposit(ctx context.Context, conn core.WriteCloser)
- func RspUploadFile(ctx context.Context, _ core.WriteCloser)
- func RspUploadFileSlice(ctx context.Context, conn core.WriteCloser)
- func RspUploadFileVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func RspUploadFileWithNoReqIdVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func RspUploadSlicesWrong(ctx context.Context, _ core.WriteCloser)
- func ScheduleReqBackupStatus(ctx context.Context, fileHash string)
- func SendReportBackupSliceResult(ctx context.Context, taskId, sliceHash, spP2pAddress string, result bool, ...)
- func SendReportDownloadResult(ctx context.Context, target *protos.RspDownloadSlice, costTime int64, ...) *protos.ReqReportDownloadResult
- func SendReportStreamingResult(ctx context.Context, target *protos.RspDownloadSlice, isPP bool)
- func SendReqDownloadSlice(ctx context.Context, fileHash string, sliceInfo *protos.DownloadSliceInfo, ...)
- func SpAddressVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func SpRspVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
- func StartMaintenance(ctx context.Context, duration uint64) error
- func StartReportTransferFailureJob(ctx context.Context)
- func StopMaintenance(ctx context.Context) error
- func StopReportTransferFailureJob()
- func UpdateDeposit(ctx context.Context, depositDelta utiltypes.Coin, txFee utiltypes.TxFee) error
- func UploadFileSlice(ctx context.Context, tk *task.UploadSliceTask) error
- func UploadPause(ctx context.Context, fileHash, reqID string, w http.ResponseWriter)
- func UploadSpeedOfProgress(ctx context.Context, _ core.WriteCloser)
- func VerifyMessage(ctx context.Context, msgType header.MsgType, target interface{}) error
- type CostTimeStat
- type DownloadTimeoutHandler
- func (handler *DownloadTimeoutHandler) CanDelete(rspMessage *msg.RelayMsgBuf) bool
- func (handler *DownloadTimeoutHandler) GetDuration() time.Duration
- func (handler *DownloadTimeoutHandler) GetTimeoutMsg(reqMessage *msg.RelayMsgBuf) *msg.RelayMsgBuf
- func (handler *DownloadTimeoutHandler) Handle(ctx context.Context, message *msg.RelayMsgBuf)
- type QueuedDownloadReportToSP
- type TaskSlice
- type UploadFileHandler
- type UploadRawFileHandler
- type UploadStreamFileHandler
- type VerifierFunc
Constants ¶
const CHECK_TRANFER_FAILURE_INTERVAL = 60 // in seconds
const DOWNLOAD_SLICE_TIMEOUT = 300
const (
LOSE_SLICE_MSG = "cannot find the file slice"
)
Variables ¶
var ( DownSendCostTimeMap = &downSendCostTime{ dataMap: utils.NewAutoCleanUnsafeMap(30 * time.Minute), mux: sync.Mutex{}, } DownRecvCostTimeMap = &downRecvCostTime{ dataMap: utils.NewAutoCleanUnsafeMap(30 * time.Minute), mux: sync.Mutex{}, } )
var ( //// Maps to record uploading stats PacketIdMap = &sync.Map{} // K: reqId, V: TaskSlice{tkId+sliceNum, up/down} UpSendCostTimeMap = &upSendCostTime{ dataMap: utils.NewAutoCleanUnsafeMap(30 * time.Minute), mux: sync.Mutex{}, } UpRecvCostTimeMap = &upRecvCostTime{ dataMap: utils.NewAutoCleanUnsafeMap(30 * time.Minute), mux: sync.Mutex{}, } )
Functions ¶
func BackupFileSlice ¶ added in v0.10.0
func BackupFileSlice(ctx context.Context, tk *task.UploadSliceTask) error
func CheckAndSendRetryMessage ¶ added in v0.7.0
func CheckAndSendRetryMessage(ctx context.Context, dTask *task.DownloadTask)
func CheckTransferTimeout ¶ added in v0.11.0
func ClearExpiredShareLinks ¶ added in v0.10.0
func CreateAndSimulateTx ¶ added in v0.10.0
func CreateAndSimulateTx(txMsg sdktypes.Msg, msgType string, txFee types.TxFee, memo string, signatureKeys []relaytypes.SignatureKey) ([]byte, error)
func Deactivate ¶
Deactivate Request that an active PP node becomes inactive
func DeleteFile ¶
func DeleteShare ¶
func DownloadFileSlices ¶ added in v0.11.0
func DownloadFileSlices(ctx context.Context, target *protos.RspFileStorageInfo, reqId string)
func DownloadSliceCancel ¶
func DownloadSlicePause ¶
func FindFileList ¶ added in v0.9.0
func GetAllShareLink ¶
func GetFilePath ¶ added in v0.11.0
func GetFileReplicaInfo ¶ added in v0.10.0
func GetFileStatus ¶ added in v0.10.0
func GetFileStatus(ctx context.Context, fileHash, walletAddr string, walletPubkey, walletSign []byte, reqTime int64) *protos.RspFileStatus
GetFileStatus checks if the specified file is currently being uploaded. If it isn't, it queries the file status from SP to know if the upload succeeded or failed
func GetFileStorageInfo ¶
func GetFileStorageInfo(ctx context.Context, path, savePath, saveAs string, w http.ResponseWriter)
GetFileStorageInfo p to pp. The downloader is assumed the default wallet of this node, if this function is invoked.
func GetOngoingDownloadTaskCount ¶ added in v0.10.0
func GetOngoingDownloadTaskCount() int
func GetOngoingUploadTaskCount ¶ added in v0.10.0
func GetOngoingUploadTaskCount() int
func GetReqShareFile ¶
func GetShareFile ¶
func GetWalletOz ¶ added in v0.6.0
GetWalletOz queries current ozone balance
func HandleSendPacketCostTime ¶ added in v0.9.0
func HandleSendPacketCostTime(packetId, costTime int64)
func NoticeActivatedPP ¶ added in v0.10.0
func NoticeActivatedPP(ctx context.Context, conn core.WriteCloser)
NoticeActivatedPP Notice when this PP node was successfully activated
func NoticeDeactivatedPP ¶ added in v0.10.0
func NoticeDeactivatedPP(ctx context.Context, conn core.WriteCloser)
NoticeDeactivatedPP Notice when this PP node was successfully deactivated after threshold period (180 days)
func NoticeFileSliceBackup ¶ added in v0.10.0
func NoticeFileSliceBackup(ctx context.Context, conn core.WriteCloser)
NoticeFileSliceBackup An SP node wants this PP node to fetch the specified slice from the PP node who stores it. Both backups and transfers use the same method
func NoticeFileSliceBackupVerifier ¶ added in v0.10.0
func NoticeFileSliceBackupVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
NoticeFileSliceBackupVerifier task level verifier for all messages carrying NoticeFileSliceBackup in a transfer task
func NoticeSpUnderMaintenance ¶ added in v0.10.0
func NoticeSpUnderMaintenance(ctx context.Context, conn core.WriteCloser)
func NoticeUnbondingPP ¶ added in v0.10.0
func NoticeUnbondingPP(ctx context.Context, conn core.WriteCloser)
NoticeUnbondingPP Notice when this PP node unbonded all its deposit
func NoticeUpdatedDeposit ¶ added in v0.10.0
func NoticeUpdatedDeposit(ctx context.Context, conn core.WriteCloser)
NoticeUpdatedDeposit Notice when this PP node's deposit was successfully updated
func PpRspVerifier ¶ added in v0.10.0
func Prepay ¶
func Prepay(ctx context.Context, beneficiary []byte, amount utiltypes.Coin, txFee utiltypes.TxFee, walletAddr string, walletPubkey, wsign []byte, reqTime int64) error
Prepay PP node sends a prepay transaction
func RegisterAllEventHandlers ¶ added in v0.10.0
func RegisterAllEventHandlers()
RegisterAllEventHandler
func RegisterNewPP ¶
func RegisterNewPP(ctx context.Context, walletAddr string, walletPubkey, wsig []byte, reqTime int64)
RegisterNewPP P-SP P register to become PP
func ReqBackupFileSlice ¶ added in v0.10.0
func ReqBackupFileSlice(ctx context.Context, conn core.WriteCloser)
ReqBackupFileSlice
func ReqBackupStatus ¶ added in v0.8.0
func ReqClearDownloadTask ¶
func ReqClearDownloadTask(ctx context.Context, conn core.WriteCloser)
func ReqDownloadSlice ¶
func ReqDownloadSlice(ctx context.Context, conn core.WriteCloser)
ReqDownloadSlice download slice PP-storagePP
func ReqFileStorageInfo ¶
func ReqFileStorageInfo(ctx context.Context, conn core.WriteCloser)
ReqFileStorageInfo P-PP , PP-SP
func ReqGetHDInfo ¶
func ReqGetHDInfo(ctx context.Context, conn core.WriteCloser)
func ReqGetPPDowngradeInfo ¶ added in v0.9.0
func ReqGetWalletOzForDownload ¶ added in v0.10.0
func ReqGetWalletOzForUpload ¶ added in v0.10.0
func ReqPpLatencyCheck ¶ added in v0.10.0
func ReqPpLatencyCheck(ctx context.Context, conn core.WriteCloser)
ReqPpLatencyCheck Request latency measurement to a pp
func ReqStateChange ¶ added in v0.10.0
func ReqStateChange(ctx context.Context, conn core.WriteCloser)
func ReqTransferDownload ¶
func ReqTransferDownload(ctx context.Context, conn core.WriteCloser)
ReqTransferDownload Another PP wants to download a slice from the current PP
func ReqUploadFileSlice ¶
func ReqUploadFileSlice(ctx context.Context, conn core.WriteCloser)
ReqUploadFileSlice storage PP receives a request with file data from the PP who initiated uploading
func RequestUploadFile ¶
func RequestUploadFile(ctx context.Context, path string, isEncrypted, isVideoStream bool, desiredTier uint32, allowHigherTier bool, walletAddr string, walletPubkey, wsign []byte)
RequestUploadFile request to SP for upload file
func RspActivate ¶
func RspActivate(ctx context.Context, conn core.WriteCloser)
RspActivate Response to asking the SP node to activate this PP node
func RspBackupFileSlice ¶ added in v0.10.0
func RspBackupFileSlice(ctx context.Context, conn core.WriteCloser)
func RspBackupStatus ¶ added in v0.8.0
func RspBackupStatus(ctx context.Context, _ core.WriteCloser)
func RspBackupStatusVerifier ¶ added in v0.10.0
RspBackupStatusVerifier task level verifier for all messages carrying RspBackupStatus in a backup task
func RspBackupStatusWithNoReqIdVerifier ¶ added in v0.10.0
func RspBackupStatusWithNoReqIdVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
RspBackupStatusWithNoReqIdVerifier no reqid verification for a request message from gateway pp
func RspBadVersion ¶ added in v0.7.0
func RspBadVersion(ctx context.Context, _ core.WriteCloser)
func RspClearExpiredShareLinks ¶ added in v0.10.0
func RspClearExpiredShareLinks(ctx context.Context, conn core.WriteCloser)
func RspDeactivate ¶
func RspDeactivate(ctx context.Context, conn core.WriteCloser)
RspDeactivate Response to asking the SP node to deactivate this PP node
func RspDeleteFile ¶
func RspDeleteFile(ctx context.Context, conn core.WriteCloser)
func RspDeleteShare ¶
func RspDeleteShare(ctx context.Context, conn core.WriteCloser)
func RspDownloadFileWrong ¶ added in v0.7.0
func RspDownloadFileWrong(ctx context.Context, conn core.WriteCloser)
RspFileStorageInfo SP-PP , PP-P
func RspDownloadSlice ¶
func RspDownloadSlice(ctx context.Context, conn core.WriteCloser)
RspDownloadSlice storagePP-PP
func RspFileReplicaInfo ¶ added in v0.10.0
func RspFileReplicaInfo(ctx context.Context, conn core.WriteCloser)
func RspFileStatus ¶ added in v0.10.0
func RspFileStatus(ctx context.Context, conn core.WriteCloser)
func RspFileStorageInfo ¶
func RspFileStorageInfo(ctx context.Context, conn core.WriteCloser)
RspFileStorageInfo SP-PP , PP-P
func RspFileStorageInfoVerifier ¶ added in v0.10.0
func RspFileStorageInfoVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
RspFileStorageInfoVerifier task level verifier for all messages carrying RspFileStorageInfo in a download task
func RspFileStorageInfoWithNoReqIdVerifier ¶ added in v0.10.0
func RspFileStorageInfoWithNoReqIdVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
RspFileStorageInfoWithNoReqIdVerifier no reqid verification for a request message from gateway pp
func RspFindMyFileList ¶
func RspFindMyFileList(ctx context.Context, conn core.WriteCloser)
func RspGetHDInfo ¶
func RspGetHDInfo(ctx context.Context, conn core.WriteCloser)
func RspGetPPDowngradeInfo ¶ added in v0.9.0
func RspGetPPDowngradeInfo(ctx context.Context, conn core.WriteCloser)
RspGetPPDowngradeInfo
func RspGetPPList ¶
func RspGetPPList(ctx context.Context, conn core.WriteCloser)
func RspGetPPStatus ¶ added in v0.5.1
func RspGetPPStatus(ctx context.Context, conn core.WriteCloser)
RspGetPPStatus
func RspGetSPList ¶
func RspGetSPList(ctx context.Context, conn core.WriteCloser)
func RspGetShareFile ¶
func RspGetShareFile(ctx context.Context, _ core.WriteCloser)
func RspGetWalletOz ¶ added in v0.6.0
func RspGetWalletOz(ctx context.Context, conn core.WriteCloser)
func RspPpLatencyCheck ¶ added in v0.10.0
func RspPpLatencyCheck(ctx context.Context, _ core.WriteCloser)
func RspPrepay ¶
func RspPrepay(ctx context.Context, conn core.WriteCloser)
RspPrepay Response to asking the SP node to send a prepay transaction
func RspRegister ¶
func RspRegister(ctx context.Context, conn core.WriteCloser)
RspRegister PP -> SP, SP -> PP, PP -> P
func RspRegisterNewPP ¶
func RspRegisterNewPP(ctx context.Context, conn core.WriteCloser)
RspRegisterNewPP SP-P
func RspReportBackupSliceResult ¶ added in v0.5.0
func RspReportBackupSliceResult(ctx context.Context, conn core.WriteCloser)
RspReportBackupSliceResult
func RspReportDownloadResult ¶
func RspReportDownloadResult(ctx context.Context, conn core.WriteCloser)
RspReportDownloadResult SP-P OR SP-PP
func RspReportNodeStatus ¶ added in v0.7.0
func RspReportNodeStatus(ctx context.Context, conn core.WriteCloser)
RspReportNodeStatus
func RspReportUploadSliceResult ¶
func RspReportUploadSliceResult(ctx context.Context, conn core.WriteCloser)
RspReportUploadSliceResult SP-P OR SP-PP
func RspShareFile ¶
func RspShareFile(ctx context.Context, conn core.WriteCloser)
func RspShareLink ¶
func RspShareLink(ctx context.Context, conn core.WriteCloser)
func RspSpLatencyCheck ¶ added in v0.10.0
func RspSpLatencyCheck(ctx context.Context, _ core.WriteCloser)
RspSpLatencyCheck message RspSpLatencyCheck's handler
func RspStartMaintenance ¶ added in v0.9.0
func RspStartMaintenance(ctx context.Context, _ core.WriteCloser)
func RspStateChange ¶ added in v0.10.0
func RspStateChange(ctx context.Context, conn core.WriteCloser)
func RspStopMaintenance ¶ added in v0.9.0
func RspStopMaintenance(ctx context.Context, _ core.WriteCloser)
func RspTransferDownload ¶
func RspTransferDownload(ctx context.Context, conn core.WriteCloser)
RspTransferDownload The receiver PP gets this response from the uploader PP
func RspTransferDownloadResult ¶
func RspTransferDownloadResult(ctx context.Context, conn core.WriteCloser)
RspTransferDownloadResult The receiver PP sends this msg when the download is finished. If successful, we can report the result and delete the file
func RspUpdateDeposit ¶ added in v0.10.0
func RspUpdateDeposit(ctx context.Context, conn core.WriteCloser)
RspUpdateDeposit Response to asking the SP node to update deposit this node
func RspUploadFile ¶
func RspUploadFile(ctx context.Context, _ core.WriteCloser)
RspUploadFile response of upload file event, SP -> upgrader, upgrader -> dest PP
func RspUploadFileSlice ¶
func RspUploadFileSlice(ctx context.Context, conn core.WriteCloser)
func RspUploadFileVerifier ¶ added in v0.10.0
RspUploadFileVerifier task level verifier for all messages carrying RspUploadFile in a uploading task
func RspUploadFileWithNoReqIdVerifier ¶ added in v0.10.0
func RspUploadFileWithNoReqIdVerifier(ctx context.Context, msgType header.MsgType, target interface{}) error
RspUploadFileWithNoReqIdVerifier no reqid verification for a request message from gateway pp
func RspUploadSlicesWrong ¶ added in v0.9.0
func RspUploadSlicesWrong(ctx context.Context, _ core.WriteCloser)
RspUploadSlicesWrong updates the destination of slices for an ongoing upload
func ScheduleReqBackupStatus ¶ added in v0.8.0
func SendReportBackupSliceResult ¶ added in v0.5.0
func SendReportDownloadResult ¶
func SendReportDownloadResult(ctx context.Context, target *protos.RspDownloadSlice, costTime int64, isPP bool) *protos.ReqReportDownloadResult
SendReportDownloadResult PP-SP OR StoragePP-SP
func SendReportStreamingResult ¶
func SendReportStreamingResult(ctx context.Context, target *protos.RspDownloadSlice, isPP bool)
SendReportStreamingResult P-SP OR PP-SP
func SendReqDownloadSlice ¶
func SendReqDownloadSlice(ctx context.Context, fileHash string, sliceInfo *protos.DownloadSliceInfo, req *protos.ReqDownloadSlice, fileReqId string)
func SpAddressVerifier ¶ added in v0.10.0
func SpRspVerifier ¶ added in v0.10.0
func StartMaintenance ¶ added in v0.9.0
StartMaintenance sends a request to SP to temporarily put the current node into maintenance mode
func StartReportTransferFailureJob ¶ added in v0.11.0
func StopMaintenance ¶ added in v0.9.0
func StopReportTransferFailureJob ¶ added in v0.11.0
func StopReportTransferFailureJob()
func UpdateDeposit ¶ added in v0.10.0
UpdateDeposit Update deposit of node
func UploadFileSlice ¶
func UploadFileSlice(ctx context.Context, tk *task.UploadSliceTask) error
func UploadPause ¶
func UploadPause(ctx context.Context, fileHash, reqID string, w http.ResponseWriter)
func UploadSpeedOfProgress ¶
func UploadSpeedOfProgress(ctx context.Context, _ core.WriteCloser)
Types ¶
type CostTimeStat ¶ added in v0.9.0
type DownloadTimeoutHandler ¶ added in v0.7.0
type DownloadTimeoutHandler struct { }
func (*DownloadTimeoutHandler) CanDelete ¶ added in v0.7.0
func (handler *DownloadTimeoutHandler) CanDelete(rspMessage *msg.RelayMsgBuf) bool
func (*DownloadTimeoutHandler) GetDuration ¶ added in v0.7.0
func (handler *DownloadTimeoutHandler) GetDuration() time.Duration
func (*DownloadTimeoutHandler) GetTimeoutMsg ¶ added in v0.7.0
func (handler *DownloadTimeoutHandler) GetTimeoutMsg(reqMessage *msg.RelayMsgBuf) *msg.RelayMsgBuf
func (*DownloadTimeoutHandler) Handle ¶ added in v0.7.0
func (handler *DownloadTimeoutHandler) Handle(ctx context.Context, message *msg.RelayMsgBuf)
type QueuedDownloadReportToSP ¶ added in v0.9.0
type QueuedDownloadReportToSP struct {
// contains filtered or unexported fields
}
type UploadFileHandler ¶ added in v0.10.0
type UploadFileHandler interface {
PreUpload(ctx context.Context, filePath, encryptionTag string) (*protos.FileInfo, []*protos.SliceHashAddr, error)
}
func GetUploadFileHandler ¶ added in v0.10.0
func GetUploadFileHandler(isVideoStream bool) UploadFileHandler
type UploadRawFileHandler ¶ added in v0.10.0
type UploadRawFileHandler struct { }
type UploadStreamFileHandler ¶ added in v0.10.0
type UploadStreamFileHandler struct { }
Source Files ¶
- activate.go
- bad_version.go
- clear_expired_share.go
- data.go
- deactivate.go
- delete_file.go
- download_file_wrong.go
- download_slice.go
- event_handle.go
- find_file.go
- get_pp_downgrade_info.go
- get_pp_status.go
- get_pplist.go
- get_splist.go
- get_wallet_oz.go
- maintenance.go
- pp_latency.go
- prepay.go
- query_file_info.go
- register_new_pp.go
- register_to_sp.go
- report_node_status.go
- share.go
- sp_latency.go
- sp_maintenance.go
- state_change.go
- sys_info.go
- timeout_handler.go
- transfer_slice.go
- update_stake.go
- upload_file.go
- upload_slice.go
- verification.go