rpc

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GENERIC_ERR                   string = "-1"
	SIGNATURE_FAILURE             string = "-3"
	WRONG_FILE_SIZE               string = "-4"
	TIME_OUT                      string = "-5"
	FILE_REQ_FAILURE              string = "-6"
	WRONG_INPUT                   string = "-7"
	WRONG_PP_ADDRESS              string = "-8"
	INTERNAL_DATA_FAILURE         string = "-9"
	INTERNAL_COMM_FAILURE         string = "-10"
	WRONG_FILE_INFO               string = "-11"
	WRONG_WALLET_ADDRESS          string = "-12"
	CONFLICT_WITH_ANOTHER_SESSION string = "-13"
	SESSION_STOPPED               string = "-14"

	UPLOAD_DATA     string = "1"
	DOWNLOAD_OK     string = "2"
	DL_OK_ASK_INFO  string = "3"
	SHARED_DL_START string = "4"
	SUCCESS         string = "0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivateResult added in v0.10.0

type ActivateResult struct {
	Return          string `json:"return"`
	ActivationState uint32 `json:"activationstate"`
}

type ClearExpiredShareLinksResult added in v0.10.0

type ClearExpiredShareLinksResult struct {
	WalletAddr string `json:"walletaddr"`
	Return     string `json:"return"`
	Deleted    uint32 `json:"deleted"`
	NewCount   uint32 `json:"new_count"`
}

type FileInfo

type FileInfo struct {
	FileHash    string `json:"filehash"`
	FileSize    uint64 `json:"filesize"`
	FileName    string `json:"filename"`
	CreateTime  uint64 `json:"createtime,omitempty"`
	LinkTime    int64  `json:"linktime,omitempty"`
	LinkTimeExp int64  `json:"linktimeexp,omitempty"`
	ShareId     string `json:"shareid,omitempty"`
	ShareLink   string `json:"sharelink,omitempty"`
}

type FileListResult

type FileListResult struct {
	Return      string     `json:"return"`
	FileInfo    []FileInfo `json:"fileinfo,omitempty"`
	TotalNumber uint64     `json:"totalnumber,omitempty"`
	PageId      uint64     `json:"page,omitempty"`
}

type FileShareResult

type FileShareResult struct {
	Return         string     `json:"return"`
	ShareId        string     `json:"shareid,omitempty"`
	ShareLink      string     `json:"sharelink,omitempty"`
	FileInfo       []FileInfo `json:"fileinfo,omitempty"`
	TotalNumber    uint64     `json:"totalnumber,omitempty"`
	PageId         uint64     `json:"page,omitempty"`
	SequenceNumber string     `json:"sequencynumber,omitempty"`
}

type FileStatusResult added in v0.10.0

type FileStatusResult struct {
	Return          string                 `json:"return"`
	Error           string                 `json:"error,omitempty"`
	FileUploadState protos.FileUploadState `json:"file_upload_state"`
	UserHasFile     bool                   `json:"user_has_file"`
	Replicas        uint32                 `json:"replicas"`
}

type GetOzoneResult

type GetOzoneResult struct {
	Return         string `json:"return"`
	Ozone          string `json:"ozone,omitempty"`
	SequenceNumber string `json:"sequencynumber,omitempty"`
}

result for getozone

type ParamDownloadData

type ParamDownloadData struct {
	FileHash string `json:"filehash"`
	ReqId    string `json:"reqid"`
}

download: download file data

type ParamDownloadFileInfo

type ParamDownloadFileInfo struct {
	FileHash string `json:"filehash"`
	FileSize uint64 `json:"filesize"`
	ReqId    string `json:"reqid"`
}

download: downloaded file info

type ParamGetFileStatus added in v0.10.0

type ParamGetFileStatus struct {
	FileHash  string    `json:"filehash"`
	Signature Signature `json:"signature"`
	ReqTime   int64     `json:"req_time"`
}

get current file status

type ParamReqActivate added in v0.10.0

type ParamReqActivate struct {
	WalletAddr string `json:"walletaddr"`
	Deposit    string `json:"deposit"`
	Fee        string `json:"fee"`
	Gas        uint64 `json:"gas"`
}

activate: request to activate pp node

type ParamReqClearExpiredShareLinks struct {
	Signature Signature `json:"signature"`
	ReqTime   int64     `json:"req_time"`
}

share: request to clear expired share links

type ParamReqDownloadData added in v0.10.0

type ParamReqDownloadData struct {
	FileHash       string `json:"filehash"`
	ReqId          string `json:"reqid"`
	SliceHash      string `json:"slicehash"`
	SliceNumber    uint64 `json:"slicenumber"`
	SliceSize      uint64 `json:"slicesize"`
	NetworkAddress string `json:"networkaddress"`
	P2PAddress     string `json:"p2pAddress"`
	ReqTime        int64  `json:"req_time"`
}

download: download file data

type ParamReqDownloadFile

type ParamReqDownloadFile struct {
	FileHandle string    `json:"filehandle"`
	Signature  Signature `json:"signature"`
	ReqTime    int64     `json:"req_time"`
}

download: request download file

type ParamReqDownloadShared

type ParamReqDownloadShared struct {
	FileHash  string    `json:"filehash"`
	Signature Signature `json:"signature"`
	ReqId     string    `json:"reqid"`
	ReqTime   int64     `json:"req_time"`
}

share: request list shared files

type ParamReqFileList

type ParamReqFileList struct {
	Signature Signature `json:"signature"`
	PageId    uint64    `json:"page"`
	ReqTime   int64     `json:"req_time"`
}

list: request file list

type ParamReqGetOzone

type ParamReqGetOzone struct {
	WalletAddr string `json:"walletaddr"`
}

ozone: get ozone

type ParamReqGetShared

type ParamReqGetShared struct {
	Signature Signature `json:"signature"`
	ShareLink string    `json:"sharelink"`
	ReqTime   int64     `json:"req_time"`
}

share: request download a shared file

type ParamReqListShared

type ParamReqListShared struct {
	Signature Signature `json:"signature"`
	PageId    uint64    `json:"page"`
	ReqTime   int64     `json:"req_time"`
}

share: request list shared files

type ParamReqPrepay added in v0.10.0

type ParamReqPrepay struct {
	Signature    Signature `json:"signature"`
	PrepayAmount string    `json:"prepayamount"`
	Fee          string    `json:"fee"`
	Gas          uint64    `json:"gas"`
	ReqTime      int64     `json:"req_time"`
}

prepay: request to buy ozone using token

type ParamReqRP added in v0.10.0

type ParamReqRP struct {
	//P2PAddr    string `json:"p2paddr"`
	Signature Signature `json:"signature"`
	ReqTime   int64     `json:"req_time"`
}

rp: request RegisterNewPP

type ParamReqSend added in v0.10.0

type ParamReqSend struct {
	Amount string `json:"amount"`
	To     string `json:"to"`
	Fee    string `json:"fee"`
	Gas    uint64 `json:"gas"`
}

type ParamReqServiceStatus added in v0.10.0

type ParamReqServiceStatus struct {
	WalletAddr string `json:"walletaddr"`
}

type ParamReqShareFile

type ParamReqShareFile struct {
	FileHash    string    `json:"filehash"`
	Signature   Signature `json:"signature"`
	Duration    int64     `json:"duration"`
	PrivateFlag bool      `json:"bool"`
	ReqTime     int64     `json:"req_time"`
}

share: request share a file

type ParamReqStartMining added in v0.10.0

type ParamReqStartMining struct {
	WalletAddr string `json:"walletaddr"`
}

startmining: request to startmining

type ParamReqStatus added in v0.10.0

type ParamReqStatus struct {
	WalletAddr string `json:"walletaddr"`
}

type ParamReqStopShare

type ParamReqStopShare struct {
	Signature Signature `json:"signature"`
	ShareId   string    `json:"shareid"`
	ReqTime   int64     `json:"req_time"`
}

share: request stop sharing a file

type ParamReqSync added in v0.11.4

type ParamReqSync struct {
	TxHash string `json:"tx_hash"`
}

type ParamReqUpdatePPInfo added in v0.12.0

type ParamReqUpdatePPInfo struct {
	Moniker         string `json:"moniker"`
	Identity        string `json:"identity"`
	Website         string `json:"website"`
	SecurityContact string `json:"security_contact"`
	Details         string `json:"details"`
	Fee             string `json:"fee"`
	Gas             uint64 `json:"gas"`
}

type ParamReqUploadFile

type ParamReqUploadFile struct {
	FileName        string    `json:"filename"`
	FileSize        int       `json:"filesize"`
	FileHash        string    `json:"filehash"`
	Signature       Signature `json:"signature"`
	DesiredTier     uint32    `json:"desired_tier"`
	AllowHigherTier bool      `json:"allow_higher_tier"`
	ReqTime         int64     `json:"req_time"`
	SequenceNumber  string    `json:"sequencenumber"`
}

upload: request upload file

type ParamReqWithdraw added in v0.10.0

type ParamReqWithdraw struct {
	Amount        string `json:"amount"`
	TargetAddress string `json:"target_address"`
	Fee           string `json:"fee"`
	Gas           uint64 `json:"gas"`
}

type ParamUploadData

type ParamUploadData struct {
	FileHash       string    `json:"filehash"`
	Data           string    `json:"data"`
	Signature      Signature `json:"signature"`
	ReqTime        int64     `json:"req_time"`
	SequenceNumber string    `json:"sequencenumber"`
	Stop           bool      `json:"stop,omitempty"`
}

upload: upload file data

type PrepayResult added in v0.10.0

type PrepayResult struct {
	Return string `json:"return"`
}

type RPResult added in v0.10.0

type RPResult struct {
	Return    string `json:"return"`
	AlreadyPp bool   `json:"alreadypp"`
}

type Result

type Result struct {
	Return         string  `json:"return"`
	ReqId          string  `json:"reqid,omitempty"`
	OffsetStart    *uint64 `json:"offsetstart,omitempty"`
	OffsetEnd      *uint64 `json:"offsetend,omitempty"`
	FileHash       string  `json:"filehash,omitempty"`
	FileName       string  `json:"filename,omitempty"`
	FileData       string  `json:"filedata,omitempty"`
	SequenceNumber string  `json:"sequencenumber,omitempty"`
}

result for all upload and download messages

type SendResult added in v0.10.0

type SendResult struct {
	Return string `json:"return"`
}

type ServiceStatusResult added in v0.10.0

type ServiceStatusResult struct {
	Return  string `json:"return"`
	Message string `json:"message"`
}

type Signature added in v0.10.0

type Signature struct {
	Address   string `json:"address"`
	Pubkey    string `json:"pubkey"`
	Signature string `json:"signature"` // Hex-encoded
}

type StartMiningResult added in v0.10.0

type StartMiningResult struct {
	Return string `json:"return"`
}

type StatusResult added in v0.10.0

type StatusResult struct {
	Return  string `json:"return"`
	Message string `json:"message"`
}

type SyncResult added in v0.11.4

type SyncResult struct {
	Return string `json:"return"`
}

type UpdatePPInfoResult added in v0.12.0

type UpdatePPInfoResult struct {
	Return  string `json:"return"`
	Message string `json:"message"`
}

type WithdrawResult added in v0.10.0

type WithdrawResult struct {
	Return string `json:"return"`
}

Jump to

Keyboard shortcuts

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