Versions in this module Expand all Collapse all v0 v0.2.5 Nov 7, 2025 v0.2.4 Nov 3, 2025 v0.2.3 Oct 28, 2025 v0.2.2 Oct 21, 2025 v0.2.1 Oct 14, 2025 v0.2.0 Oct 9, 2025 v0.1.5 Sep 22, 2025 v0.1.4 Sep 19, 2025 v0.1.3 Sep 19, 2025 v0.1.2 Sep 10, 2025 Changes in this version + func FetchDataAndFlag(gatewayUrl, token, fid, did string) (string, []byte, error) v0.1.1 Aug 18, 2025 v0.1.0 Aug 18, 2025 Changes in this version + const AUDIT_DATA_URL + const CLAIM_DATA_URL + const ERROR_MESSAGE + const FETCH_CACHE_DATA_URL + const FETCH_DATA_URL + const FRAGMENT_SIZE + const NODE_STATUS_URL + const PUSH_DATA_URL + const QUERY_CAPACITY_URL + const QUERY_DATA_INFO_URL + const QUERY_TEE_INFO + const SUCCESS_MESSAGE + func AuditData(url, fpath, rpath string, req TeeReq) error + func CheckStorageNodeAvailable(baseUrl string) error + func ClaimOffloadingData(url string, req FileRequest) ([]byte, string, error) + func FetchFile(gatewayUrl, token, fid, did string) ([]byte, error) + func GetFileFromStorageNode(url, acc, message, sign, fid, fragment, path string) error + func PushFile(url, fpath string, metaDatas map[string][]byte) ([]byte, error) + func PushFileToStorageNode(url, acc, message, sign, fid, fragment, path string) error + func QueryRemainCap(url, requester string) (uint64, error) + func RechargeCapacity(url, requester string, orderId [32]byte) error + func SendHttpRequest(method, url string, headers map[string]string, dataReader *bytes.Buffer) ([]byte, error) + type CacheRequest struct + Did string + Exp int64 + ExtData string + RequestId string + Sign []byte + UserAddr string + type Cd2nNode struct + ActiveStorageNodes []string + EndPoint string + IsGateway bool + PoolId string + RedisAddr string + TeeAddr string + TeePubkey []byte + Version string + WorkAddr string + func CheckCdnNodeAvailable(baseUrl string) (Cd2nNode, error) + type DiskStatus struct + BufferItemNum uint64 + BufferUsage float32 + CacheItemNum uint64 + CacheUsage float32 + UsedBufferSize uint64 + UsedCacheSize uint64 + type DistStatus struct + Done uint64 + FidNum uint64 + Ongoing uint64 + Retried uint64 + type DownloadStatus struct + DlingNum uint64 + type FileMeta struct + Did string + Key string + Provider string + Size int64 + Tid string + Timestamp string + type FileRequest struct + Fid string + Pubkey []byte + Sign string + StorageNodes []StorageNode + Timestamp string + type FileResponse struct + Fid string + Fragments []string + Token string + func ClaimFile(url string, req FileRequest) (FileResponse, error) + type Response struct + Code int + Data any + Msg string + func NewResponse(code int, msg string, data any) Response + func (r Response) Error() error + func (r Response) Result() any + func (r Response) Status() int + type RetrieveStatus struct + NTBR uint64 + RetrieveNum uint64 + RetrievedNum uint64 + type Status struct + type StorageNode struct + Account string + Endpoint string + type TeeReq struct + Cid string + Data []byte + Key []byte + Nonce []byte + OrderId []byte + RequestId string + SupplierAcc string + UserAcc string + UserSign []byte + type TeeResp struct + Data any + EthAddress string + Msg string + Pubkey []byte + RemainCap uint64 + UserAcc string + func QueryTeeInfo(url string) (TeeResp, error)