Documentation
¶
Index ¶
- Constants
- func Delete(dbFilepath, key, value string) error
- func ExecOsCmd(cmdStr string, checkStdErr bool) (string, error)
- func ExecOsCmd2Screen(cmdStr string, checkStdErr bool) (string, error)
- func ExecOsCmdBase(cmdStr string, out2Screen bool, checkStdErr bool) (string, error)
- func Get(dbFilepath, key string) ([]byte, error)
- func HttpDelete(uri, tokenString string, params interface{}) string
- func HttpGet(uri, tokenString string, params interface{}) string
- func HttpGetNoToken(uri string, params interface{}) string
- func HttpPost(uri, tokenString string, params interface{}) string
- func HttpPostFile(url string, tokenString string, paramTexts map[string]string, ...) (string, error)
- func HttpPostNoToken(uri string, params interface{}) string
- func HttpPut(uri, tokenString string, params interface{}) string
- func HttpPutFile(url string, tokenString string, paramTexts map[string]string, ...) (string, error)
- func HttpRequestFile(httpMethod, url string, tokenString string, paramTexts map[string]string, ...) (string, error)
- func IpfsUploadCarFile(carFilePath string) (*string, error)
- func LotusGetMinerConfig(minerFid string) (*decimal.Decimal, *decimal.Decimal, *string, *string)
- func LotusProposeOfflineDeal(carFile model.FileDesc, cost decimal.Decimal, pieceSize int64, ...) (*string, *int, error)
- func Put(dbFilepath, key, value string) error
- type Cid
- type ClientCalcCommP
- type ClientCalcCommPResult
- type ClientFileParam
- type ClientImport
- type ClientImportResult
- type ClientStartDeal
- type ClientStartDealParam
- type ClientStartDealParamData
- type GetOfflineDealData
- type GetOfflineDealResponse
- type GetOfflineDealsByTaskUuidResult
- type GetOfflineDealsByTaskUuidResultData
- type GetTaskResult
- type GetTaskResultData
- type JsonRpcError
- type LotusClient
- func (lotusClient *LotusClient) LotusClientCalcCommP(filepath string) *string
- func (lotusClient *LotusClient) LotusClientGenCar(srcFilePath, destCarFilePath string, srcFilePathIsCar bool) error
- func (lotusClient *LotusClient) LotusClientImport(filepath string, isCar bool) (*string, error)
- func (lotusClient *LotusClient) LotusClientStartDeal(carFile model.FileDesc, cost decimal.Decimal, pieceSize int64, ...) (*string, error)
- func (lotusClient *LotusClient) LotusMarketGetAsk() *MarketGetAskResultAsk
- func (lotusClient *LotusClient) LotusVersion() (*string, error)
- type LotusJsonRpcParams
- type LotusJsonRpcResult
- type LotusVersionResponse
- type LotusVersionResult
- type MarketGetAsk
- type MarketGetAskResult
- type MarketGetAskResultAsk
- type SwanClient
- func (swanClient *SwanClient) SwanCreateTask(task model.Task, csvFilePath string) (*SwanCreateTaskResponse, error)
- func (swanClient *SwanClient) SwanGetAssignedTasks() ([]model.Task, error)
- func (swanClient *SwanClient) SwanGetJwtToken(apiKey, accessToken string) error
- func (swanClient *SwanClient) SwanGetOfflineDeals(minerFid, status string, limit ...string) []model.OfflineDeal
- func (swanClient *SwanClient) SwanGetOfflineDealsByTaskUuid(taskUuid string) (*GetOfflineDealsByTaskUuidResult, error)
- func (swanClient *SwanClient) SwanGetTasks(limit *int) (*GetTaskResult, error)
- func (swanClient *SwanClient) SwanUpdateAssignedTask(taskUuid, status, csvFilePath string) (*SwanCreateTaskResponse, error)
- func (swanClient *SwanClient) SwanUpdateOfflineDealStatus(dealId int, status string, statusInfo ...string) bool
- func (swanClient *SwanClient) SwanUpdateTaskByUuid(taskUuid string, minerFid string, csvFilePath string) error
- type SwanCreateTaskResponse
- type SwanCreateTaskResponseData
- type TokenAccessInfo
- type UpdateOfflineDealData
- type UpdateOfflineDealResponse
Constants ¶
View Source
const ( LOTUS_JSON_RPC_ID = 7878 LOTUS_JSON_RPC_VERSION = "2.0" LOTUS_CLIENT_GET_DEAL_INFO = "Filecoin.ClientGetDealInfo" LOTUS_CLIENT_GET_DEAL_STATUS = "Filecoin.ClientGetDealStatus" LOTUS_CHAIN_HEAD = "Filecoin.ChainHead" LOTUS_MARKET_GET_ASK = "Filecoin.MarketGetAsk" LOTUS_CLIENT_CALC_COMM_P = "Filecoin.ClientCalcCommP" LOTUS_CLIENT_IMPORT = "Filecoin.ClientImport" LOTUS_CLIENT_GEN_CAR = "Filecoin.ClientGenCar" LOTUS_CLIENT_START_DEAL = "Filecoin.ClientStartDeal" LOTUS_VERSION = "Filecoin.Version" )
View Source
const GET_OFFLINEDEAL_LIMIT_DEFAULT = 50
View Source
const HTTP_CONTENT_TYPE_FORM = "application/x-www-form-urlencoded"
View Source
const HTTP_CONTENT_TYPE_JSON = "application/json; charset=utf-8"
View Source
const RESPONSE_STATUS_SUCCESS = "SUCCESS"
View Source
const SHELL_TO_USE = "bash"
Variables ¶
This section is empty.
Functions ¶
func ExecOsCmdBase ¶
func HttpDelete ¶
func HttpGetNoToken ¶
func HttpPostFile ¶
func HttpPostNoToken ¶
func HttpPutFile ¶
func HttpRequestFile ¶
func IpfsUploadCarFile ¶
func LotusGetMinerConfig ¶
func LotusProposeOfflineDeal ¶
Types ¶
type ClientCalcCommP ¶
type ClientCalcCommP struct { LotusJsonRpcResult Result *ClientCalcCommPResult `json:"result"` }
type ClientCalcCommPResult ¶
type ClientFileParam ¶
type ClientImport ¶
type ClientImport struct { LotusJsonRpcResult Result *ClientImportResult `json:"result"` }
type ClientImportResult ¶
type ClientStartDeal ¶
type ClientStartDeal struct { LotusJsonRpcResult Result *Cid `json:"result"` }
type ClientStartDealParam ¶
type GetOfflineDealData ¶
type GetOfflineDealData struct {
Deal []model.OfflineDeal `json:"deal"`
}
type GetOfflineDealResponse ¶
type GetOfflineDealResponse struct { Data GetOfflineDealData `json:"data"` Status string `json:"status"` }
type GetOfflineDealsByTaskUuidResult ¶
type GetOfflineDealsByTaskUuidResult struct { Data GetOfflineDealsByTaskUuidResultData `json:"data"` Status string `json:"status"` }
type GetTaskResult ¶
type GetTaskResult struct { Data GetTaskResultData `json:"data"` Status string `json:"status"` }
type GetTaskResultData ¶
type JsonRpcError ¶
type LotusClient ¶
func LotusGetClient ¶
func LotusGetClient(apiUrl, accessToken string) (*LotusClient, error)
func (*LotusClient) LotusClientCalcCommP ¶
func (lotusClient *LotusClient) LotusClientCalcCommP(filepath string) *string
"lotus client commP " + carFilePath
func (*LotusClient) LotusClientGenCar ¶
func (lotusClient *LotusClient) LotusClientGenCar(srcFilePath, destCarFilePath string, srcFilePathIsCar bool) error
"lotus client generate-car " + srcFilePath + " " + destCarFilePath
func (*LotusClient) LotusClientImport ¶
func (lotusClient *LotusClient) LotusClientImport(filepath string, isCar bool) (*string, error)
"lotus client import --car " + carFilePath
func (*LotusClient) LotusClientStartDeal ¶
func (lotusClient *LotusClient) LotusClientStartDeal(carFile model.FileDesc, cost decimal.Decimal, pieceSize int64, dealConfig model.ConfDeal) (*string, error)
"lotus client generate-car " + srcFilePath + " " + destCarFilePath
func (*LotusClient) LotusMarketGetAsk ¶
func (lotusClient *LotusClient) LotusMarketGetAsk() *MarketGetAskResultAsk
"lotus client query-ask " + minerFid
func (*LotusClient) LotusVersion ¶
func (lotusClient *LotusClient) LotusVersion() (*string, error)
"lotus client query-ask " + minerFid
type LotusJsonRpcParams ¶
type LotusJsonRpcResult ¶
type LotusJsonRpcResult struct { Id int `json:"id"` JsonRpc string `json:"jsonrpc"` Error *JsonRpcError `json:"error"` }
type LotusVersionResponse ¶
type LotusVersionResponse struct { LotusJsonRpcResult Result LotusVersionResult `json:"result"` }
type LotusVersionResult ¶
type MarketGetAsk ¶
type MarketGetAsk struct { LotusJsonRpcResult Result *MarketGetAskResult `json:"result"` }
type MarketGetAskResult ¶
type MarketGetAskResult struct {
Ask MarketGetAskResultAsk
}
type MarketGetAskResultAsk ¶
type SwanClient ¶
func SwanGetClient ¶
func SwanGetClient(apiUrl, apiKey, accessToken string) (*SwanClient, error)
func (*SwanClient) SwanCreateTask ¶
func (swanClient *SwanClient) SwanCreateTask(task model.Task, csvFilePath string) (*SwanCreateTaskResponse, error)
func (*SwanClient) SwanGetAssignedTasks ¶
func (swanClient *SwanClient) SwanGetAssignedTasks() ([]model.Task, error)
func (*SwanClient) SwanGetJwtToken ¶
func (swanClient *SwanClient) SwanGetJwtToken(apiKey, accessToken string) error
func (*SwanClient) SwanGetOfflineDeals ¶
func (swanClient *SwanClient) SwanGetOfflineDeals(minerFid, status string, limit ...string) []model.OfflineDeal
func (*SwanClient) SwanGetOfflineDealsByTaskUuid ¶
func (swanClient *SwanClient) SwanGetOfflineDealsByTaskUuid(taskUuid string) (*GetOfflineDealsByTaskUuidResult, error)
func (*SwanClient) SwanGetTasks ¶
func (swanClient *SwanClient) SwanGetTasks(limit *int) (*GetTaskResult, error)
func (*SwanClient) SwanUpdateAssignedTask ¶
func (swanClient *SwanClient) SwanUpdateAssignedTask(taskUuid, status, csvFilePath string) (*SwanCreateTaskResponse, error)
func (*SwanClient) SwanUpdateOfflineDealStatus ¶
func (swanClient *SwanClient) SwanUpdateOfflineDealStatus(dealId int, status string, statusInfo ...string) bool
func (*SwanClient) SwanUpdateTaskByUuid ¶
func (swanClient *SwanClient) SwanUpdateTaskByUuid(taskUuid string, minerFid string, csvFilePath string) error
type SwanCreateTaskResponse ¶
type SwanCreateTaskResponse struct { Data SwanCreateTaskResponseData `json:"data"` Status string `json:"status"` Message string `json:"message"` }
type TokenAccessInfo ¶
type UpdateOfflineDealData ¶
type UpdateOfflineDealData struct { Deal model.OfflineDeal `json:"deal"` Message string `json:"message"` }
type UpdateOfflineDealResponse ¶
type UpdateOfflineDealResponse struct { Data UpdateOfflineDealData `json:"data"` Status string `json:"status"` }
Click to show internal directories.
Click to hide internal directories.