requests

package
v0.11.8 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const INVALID_STAT = int64(-1)

Variables

This section is empty.

Functions

func ClearExpiredShareLinksData added in v0.10.0

func ClearExpiredShareLinksData(p2pAddress, walletAddr string, walletPubkey, wsign []byte, reqTime int64) *protos.ReqClearExpiredShareLinks

func FindFileListData added in v0.9.0

func FindFileListData(fileName string, walletAddr, p2pAddress string, pageId uint64, keyword string, fileType protos.FileSortType, isUp bool, walletPubkey, wsign []byte, reqTime int64) *protos.ReqFindMyFileList

func GetReqIdFromMessage added in v0.7.0

func GetReqIdFromMessage(ctx context.Context) int64

func GetSliceOffset added in v0.10.0

func GetSliceOffset(sliceNumber, sliceCount, sliceSize, fileSize uint64) *protos.SliceOffset

func GetSpPubkey added in v0.9.0

func GetSpPubkey(spP2pAddr string) ([]byte, error)

func PPMsgHeader

func PPMsgHeader(dataLen uint32, msgType header.MsgType) header.MessageHead

func ReqBackupFileSliceData added in v0.10.0

func ReqBackupFileSliceData(ctx context.Context, task *task.UploadSliceTask, pieceOffset *protos.SliceOffset, data []byte) *protos.ReqBackupFileSlice

func ReqDeleteFileData

func ReqDeleteFileData(fileHash, p2pAddress string, walletAddr string, walletPubkey, wsign []byte, reqTime int64) *protos.ReqDeleteFile

func ReqDeleteShareData

func ReqDeleteShareData(shareID, walletAddr, p2pAddress string, walletPubkey, wsign []byte, reqTime int64) *protos.ReqDeleteShare

func ReqDowngradeInfo added in v0.9.0

func ReqDowngradeInfo(ctx context.Context) *protos.ReqGetPPDowngradeInfo

func ReqDownloadFileWrongData added in v0.7.0

func ReqDownloadFileWrongData(fInfo *protos.RspFileStorageInfo, dTask *task.DownloadTask) *protos.ReqDownloadFileWrong

func ReqFileReplicaInfo added in v0.10.0

func ReqFileReplicaInfo(path, walletAddr, p2pAddress string, replicaIncreaseNum uint32, walletPubkey, walletSign []byte, reqTime int64) *protos.ReqFileReplicaInfo

func ReqFileStatus added in v0.10.0

func ReqFileStatus(fileHash, walletAddr, taskId string, walletPubkey, walletSign []byte, reqTime int64) *protos.ReqFileStatus

func ReqFileStorageInfoData

func ReqFileStorageInfoData(ctx context.Context, path, savePath, saveAs, walletAddr string, walletPUbkey, wsig []byte, shareRequest *protos.ReqGetShareFile, reqTime int64) *protos.ReqFileStorageInfo

ReqFileStorageInfoData encode ReqFileStorageInfo message. If it's not a "share request", walletAddr should keep the same as the wallet from the "path".

func ReqGetPPStatusData added in v0.5.1

func ReqGetPPStatusData(ctx context.Context, initPPList bool) *protos.ReqGetPPStatus

func ReqGetPPlistData

func ReqGetPPlistData(ctx context.Context) *protos.ReqGetPPList

func ReqGetSPlistData

func ReqGetSPlistData(ctx context.Context, walletAddr string, walletPubkey, wsig []byte, reqTime int64) *protos.ReqGetSPList

func ReqGetShareFileData

func ReqGetShareFileData(keyword, sharePassword, saveAs, walletAddr, p2pAddress string, walletPubkey, wsign []byte, isVideoStream bool, reqTime int64) *protos.ReqGetShareFile

func ReqGetWalletOzData added in v0.6.0

func ReqGetWalletOzData(walletAddr, reqId string) *protos.ReqGetWalletOz

func ReqMiningData

func ReqMiningData(ctx context.Context) *protos.ReqMining

func ReqNodeStatusData

func ReqNodeStatusData(p2pAddress string) *protos.ReqReportNodeStatus

func ReqRegisterData

func ReqRegisterData(ctx context.Context, walletAddr string, walletPubkey, wsig []byte, reqTime int64) *protos.ReqRegister

func ReqRegisterDataTR

func ReqRegisterDataTR(ctx context.Context, target *protos.ReqRegister) *msg.RelayMsgBuf

func ReqRegisterNewPPData

func ReqRegisterNewPPData(ctx context.Context, walletAddr string, walletPubkey, wsig []byte, reqTime int64) *protos.ReqRegisterNewPP

func ReqReportDownloadResultData

func ReqReportDownloadResultData(ctx context.Context, target *protos.RspDownloadSlice, costTime int64, isPP bool) *protos.ReqReportDownloadResult

func ReqReportStreamResultData added in v0.9.0

func ReqReportStreamResultData(ctx context.Context, target *protos.RspDownloadSlice, isPP bool) *protos.ReqReportDownloadResult

func ReqReportUploadSliceResultData

func ReqReportUploadSliceResultData(ctx context.Context, taskId, fileHash, spP2pAddr, opponentP2pAddress string, isPp bool, slice *protos.SliceHashAddr, costTime int64) *protos.ReportUploadSliceResult

func ReqShareFileData

func ReqShareFileData(fileHash, pathHash, walletAddr, p2pAddress string, isPrivate bool, shareTime int64, walletPubkey, wsign []byte, reqTime int64) *protos.ReqShareFile

func ReqShareLinkData

func ReqShareLinkData(walletAddr, p2pAddress string, page uint64, walletPubkey, wsign []byte, reqTime int64) *protos.ReqShareLink

func ReqStartMaintenance added in v0.9.0

func ReqStartMaintenance(ctx context.Context, duration uint64) *protos.ReqStartMaintenance

func ReqStopMaintenance added in v0.9.0

func ReqStopMaintenance(ctx context.Context) *protos.ReqStopMaintenance

func ReqTransferDownloadData

func ReqTransferDownloadData(ctx context.Context, notice *protos.NoticeFileSliceBackup) *msg.RelayMsgBuf

func ReqTransferDownloadWrongData added in v0.9.0

func ReqTransferDownloadWrongData(ctx context.Context, notice *protos.NoticeFileSliceBackup) *protos.ReqTransferDownloadWrong

func ReqUploadFileSliceData

func ReqUploadFileSliceData(ctx context.Context, task *task.UploadSliceTask, pieceOffset *protos.SliceOffset, data []byte) *protos.ReqUploadFileSlice

func ReqUploadSlicesWrong added in v0.9.0

func ReqUploadSlicesWrong(ctx context.Context, uploadTask *task.UploadFileTask, spP2pAddress string, slicesToDownload []*protos.SliceHashAddr, failedSlices []bool) *protos.ReqUploadSlicesWrong

func RequestDownloadFile added in v0.9.0

func RequestDownloadFile(ctx context.Context, fileHash, sdmPath, walletAddr string, reqId string, walletSign, walletPubkey []byte, shareRequest *protos.ReqGetShareFile, reqTime int64) *protos.ReqFileStorageInfo

RequestDownloadFile the entry for rpc remote download

func RequestUploadFile added in v0.9.0

func RequestUploadFile(ctx context.Context, fileName, fileHash string, fileSize uint64, walletAddress, walletPubkey, signature string, reqTime int64,
	slices []*protos.SliceHashAddr, isEncrypted bool, desiredTier uint32, allowHigherTier bool, duration uint64) (*protos.ReqUploadFile, error)

RequestUploadFile a file from an owner instead from a "path" belongs to PP's default wallet

func RequestUploadFileData

func RequestUploadFileData(ctx context.Context, fileInfo *protos.FileInfo, slices []*protos.SliceHashAddr, desiredTier uint32, allowHigherTier bool,
	walletAddr string, walletPubkey, walletSign []byte, reqTime int64) *protos.ReqUploadFile

RequestUploadFileData assume the PP's current wallet is the owner, otherwise RequestUploadFile() should be used instead

func RspBackupFileSliceData added in v0.10.0

func RspBackupFileSliceData(target *protos.ReqBackupFileSlice) *protos.RspBackupFileSlice

func RspDownloadSliceData

func RspDownloadSliceData(ctx context.Context, target *protos.ReqDownloadSlice, slice *protos.DownloadSliceInfo) (*protos.RspDownloadSlice, [][]byte)

func RspDownloadSliceDataSplit

func RspDownloadSliceDataSplit(rsp *protos.RspDownloadSlice, dataStart, dataEnd, offsetStart, offsetEnd, sliceOffsetStart, sliceOffsetEnd uint64, data []byte, last bool) *protos.RspDownloadSlice

func RspGetHDInfoData

func RspGetHDInfoData(p2pAddress string) *protos.RspGetHDInfo

func RspTransferDownload

func RspTransferDownload(data []byte, taskId, sliceHash, spP2pAddress, p2pAddress string, offset, sliceSize uint64) *protos.RspTransferDownload

func RspTransferDownloadResultData

func RspTransferDownloadResultData(taskId, sliceHash, spP2pAddress string) *protos.RspTransferDownloadResult

func UnmarshalData

func UnmarshalData(ctx context.Context, target interface{}) bool

func UnmarshalMessageData added in v0.7.0

func UnmarshalMessageData(data []byte, target interface{}) bool

func UploadSpeedOfProgressData

func UploadSpeedOfProgressData(fileHash string, size uint64, start uint64, t int64) *protos.UploadSpeedOfProgress

Types

This section is empty.

Jump to

Keyboard shortcuts

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