Documentation
¶
Index ¶
- Constants
- type DealListByTaskUuIdResp
- type GetAutoBidCarFilesByStatusResult
- type GetAutoBidCarFilesByStatusResultData
- type GetCarFileByUuidUrlResult
- type GetCarFileByUuidUrlResultData
- type GetOfflineDealsByStatusParams
- type GetOfflineDealsByStatusResponse
- type GetTaskByUuidResult
- type GetTaskByUuidResultData
- type GetTaskResult
- type GetTaskResultData
- type LoginByApikeyParams
- type LoginByEmailParams
- type MinerResponse
- type SetHeartbeatOnlineParams
- type SwanClient
- func (swanClient *SwanClient) CheckDatacap(wallet string) (bool, error)
- func (swanClient *SwanClient) CreateOfflineDeals(fileDescs []*model.FileDesc) (*SwanServerResponse, error)
- func (swanClient *SwanClient) CreateTask(task model.Task, fileDescs []*model.FileDesc) (*SwanServerResponse, error)
- func (swanClient *SwanClient) GetAllTasks(status string) ([]model.Task, error)
- func (swanClient *SwanClient) GetAutoBidCarFilesByStatus(carFileStatus string) (*GetAutoBidCarFilesByStatusResultData, error)
- func (swanClient *SwanClient) GetCarFileByUuidUrl(taskUuid, carFileUrl string) (*GetCarFileByUuidUrlResultData, error)
- func (swanClient *SwanClient) GetDealListByTaskUuid(taskUuId string, pageNum int) (*DealListByTaskUuIdResp, error)
- func (swanClient *SwanClient) GetJwtTokenByApiKey() error
- func (swanClient *SwanClient) GetJwtTokenUp3Times() error
- func (swanClient *SwanClient) GetMiner(minerFid string) (*MinerResponse, error)
- func (swanClient *SwanClient) GetOfflineDealsByStatus(params GetOfflineDealsByStatusParams) ([]*model.OfflineDeal, error)
- func (swanClient *SwanClient) GetTaskByUuid(taskUuid string) (*GetTaskByUuidResult, error)
- func (swanClient *SwanClient) GetTasks(limit *int, status *string) (*GetTaskResult, error)
- func (swanClient *SwanClient) SendHeartbeatRequest(minerFid string) error
- func (swanClient *SwanClient) StatisticsChainInfo(chainId string) error
- func (swanClient *SwanClient) StatisticsNodeStatus() error
- func (swanClient *SwanClient) UpdateMinerBidConf(minerFid string, confMiner model.Miner) error
- func (swanClient *SwanClient) UpdateOfflineDeal(params UpdateOfflineDealParams) error
- type SwanServerResponse
- type UpdateMinerConfigParams
- type UpdateOfflineDealParams
Constants ¶
View Source
const GET_OFFLINEDEAL_LIMIT_DEFAULT = 50
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DealListByTaskUuIdResp ¶ added in v0.3.0
type DealListByTaskUuIdResp struct { Data struct { Deal []struct { DealCid string `json:"deal_cid"` MinerFid string `json:"miner_fid"` Note string `json:"note"` PayloadCid string `json:"payload_cid"` PieceCid string `json:"piece_cid"` StartEpoch int `json:"start_epoch"` Status string `json:"status"` ChainDealId int64 `json:"chain_deal_id"` } `json:"deal"` DealCompleteRate int `json:"deal_complete_rate"` Task struct { BidMode int `json:"bid_mode"` CuratedDataset string `json:"curated_dataset"` Description string `json:"description"` Duration int `json:"duration"` Status string `json:"status"` TaskName string `json:"task_name"` Type string `json:"type"` Uuid string `json:"uuid"` } `json:"task"` TotalDealCount int `json:"total_deal_count"` TotalItems int `json:"total_items"` } `json:"data"` Status string `json:"status"` }
type GetAutoBidCarFilesByStatusResult ¶ added in v0.2.81
type GetAutoBidCarFilesByStatusResult struct { Data GetAutoBidCarFilesByStatusResultData `json:"data"` Status string `json:"status"` }
type GetAutoBidCarFilesByStatusResultData ¶ added in v0.2.81
type GetAutoBidCarFilesByStatusResultData struct { CarFile model.CarFile `json:"car_file"` OfflineDeals []*model.OfflineDeal `json:"offline_deals"` TotalItems int `json:"total_items"` TotalTaskCount int `json:"total_task_count"` BidCount int `json:"bid_count"` DealCompleteRate string `json:"deal_complete_rate"` }
type GetCarFileByUuidUrlResult ¶ added in v0.2.81
type GetCarFileByUuidUrlResult struct { Data GetCarFileByUuidUrlResultData `json:"data"` Status string `json:"status"` }
type GetCarFileByUuidUrlResultData ¶ added in v0.2.81
type GetCarFileByUuidUrlResultData struct { CarFile model.CarFile `json:"car_file"` OfflineDeals []*model.OfflineDeal `json:"offline_deals"` TotalItems int `json:"total_items"` TotalTaskCount int `json:"total_task_count"` BidCount int `json:"bid_count"` DealCompleteRate string `json:"deal_complete_rate"` }
type GetOfflineDealsByStatusParams ¶ added in v0.2.82
type GetOfflineDealsByStatusResponse ¶ added in v0.2.111
type GetOfflineDealsByStatusResponse struct { Data struct { OfflineDeals []*model.OfflineDeal `json:"offline_deals"` } `json:"data"` Status string `json:"status"` }
type GetTaskByUuidResult ¶
type GetTaskByUuidResult struct { Data GetTaskByUuidResultData `json:"data"` Status string `json:"status"` }
type GetTaskByUuidResultData ¶
type GetTaskByUuidResultData struct { //AverageBid string `json:"average_bid"` Task model.Task `json:"task"` CarFiles []model.CarFile `json:"car_file"` Miner model.Miner `json:"miner"` Deal []*model.OfflineDeal `json:"deal"` TotalItems int `json:"total_items"` TotalTaskCount int `json:"total_task_count"` BidCount int `json:"bid_count"` DealCompleteRate string `json:"deal_complete_rate"` Bids []model.Bid `json:"bids"` }
type GetTaskResult ¶
type GetTaskResult struct { Data GetTaskResultData `json:"data"` Status string `json:"status"` }
type GetTaskResultData ¶
type LoginByApikeyParams ¶ added in v0.2.94
type LoginByEmailParams ¶ added in v0.2.94
type MinerResponse ¶
type SetHeartbeatOnlineParams ¶ added in v0.2.108
type SetHeartbeatOnlineParams struct {
MinerFid string `json:"miner_fid"`
}
type SwanClient ¶
func GetClient ¶ added in v0.2.81
func GetClient(apiUrl, apiKey, accessToken, swanToken string) (*SwanClient, error)
func (*SwanClient) CheckDatacap ¶ added in v0.2.35
func (swanClient *SwanClient) CheckDatacap(wallet string) (bool, error)
func (*SwanClient) CreateOfflineDeals ¶ added in v0.2.103
func (swanClient *SwanClient) CreateOfflineDeals(fileDescs []*model.FileDesc) (*SwanServerResponse, error)
for public and non auto-bid task
func (*SwanClient) CreateTask ¶ added in v0.2.81
func (swanClient *SwanClient) CreateTask(task model.Task, fileDescs []*model.FileDesc) (*SwanServerResponse, error)
func (*SwanClient) GetAllTasks ¶ added in v0.2.81
func (swanClient *SwanClient) GetAllTasks(status string) ([]model.Task, error)
func (*SwanClient) GetAutoBidCarFilesByStatus ¶ added in v0.2.81
func (swanClient *SwanClient) GetAutoBidCarFilesByStatus(carFileStatus string) (*GetAutoBidCarFilesByStatusResultData, error)
func (*SwanClient) GetCarFileByUuidUrl ¶ added in v0.2.81
func (swanClient *SwanClient) GetCarFileByUuidUrl(taskUuid, carFileUrl string) (*GetCarFileByUuidUrlResultData, error)
func (*SwanClient) GetDealListByTaskUuid ¶ added in v0.3.0
func (swanClient *SwanClient) GetDealListByTaskUuid(taskUuId string, pageNum int) (*DealListByTaskUuIdResp, error)
func (*SwanClient) GetJwtTokenByApiKey ¶ added in v0.2.94
func (swanClient *SwanClient) GetJwtTokenByApiKey() error
func (*SwanClient) GetJwtTokenUp3Times ¶ added in v0.2.81
func (swanClient *SwanClient) GetJwtTokenUp3Times() error
func (*SwanClient) GetMiner ¶
func (swanClient *SwanClient) GetMiner(minerFid string) (*MinerResponse, error)
func (*SwanClient) GetOfflineDealsByStatus ¶ added in v0.2.82
func (swanClient *SwanClient) GetOfflineDealsByStatus(params GetOfflineDealsByStatusParams) ([]*model.OfflineDeal, error)
func (*SwanClient) GetTaskByUuid ¶ added in v0.2.81
func (swanClient *SwanClient) GetTaskByUuid(taskUuid string) (*GetTaskByUuidResult, error)
func (*SwanClient) GetTasks ¶ added in v0.2.81
func (swanClient *SwanClient) GetTasks(limit *int, status *string) (*GetTaskResult, error)
func (*SwanClient) SendHeartbeatRequest ¶
func (swanClient *SwanClient) SendHeartbeatRequest(minerFid string) error
func (*SwanClient) StatisticsChainInfo ¶ added in v0.2.133
func (swanClient *SwanClient) StatisticsChainInfo(chainId string) error
func (*SwanClient) StatisticsNodeStatus ¶ added in v0.2.133
func (swanClient *SwanClient) StatisticsNodeStatus() error
func (*SwanClient) UpdateMinerBidConf ¶
func (swanClient *SwanClient) UpdateMinerBidConf(minerFid string, confMiner model.Miner) error
func (*SwanClient) UpdateOfflineDeal ¶ added in v0.2.87
func (swanClient *SwanClient) UpdateOfflineDeal(params UpdateOfflineDealParams) error
for public and auto-bid task
type SwanServerResponse ¶ added in v0.2.60
type UpdateMinerConfigParams ¶ added in v0.2.109
type UpdateOfflineDealParams ¶ added in v0.2.87
type UpdateOfflineDealParams struct { DealId int `json:"id"` DealCid *string `json:"deal_cid"` FilePath *string `json:"file_path"` Status string `json:"status"` StartEpoch *int `json:"start_epoch"` Note *string `json:"note"` Cost *string `json:"cost"` ChainDealId int64 `json:"chain_deal_id"` ClientAddr string `json:"client_addr"` AllocationID uint64 `json:"allocation_id"` }
Click to show internal directories.
Click to hide internal directories.