Documentation
¶
Index ¶
- Constants
- Variables
- func Cid(data []byte) string
- func DownloadChunkedData(hash string, modelDir string) (string, error)
- func DownloadDataSimple(hash string) ([]byte, string, error)
- func DownloadDataSimpleFromLighthouse(hash string) ([]byte, string, error)
- func DownloadFileFromLightHouse(hash string, hfDir string) error
- func DownloadToFile(hash string, filePath string) error
- func UploadData(apikey, fileName string, data []byte) (string, error)
- func UploadDataFileByUrl(ctx context.Context, apikey, rawUrl string) (string, error)
- func UploadDataWithRetry(apikey, fileName string, data []byte) (string, error)
- func UploadFile(apikey, fileName string, filePath string) (string, error)
- func UploadFileInMultiplePartsToLightHouse(fileFolder string, baseDir string, apiKey string) (string, error)
- func WriteFile(name string, data []byte, perm os.FileMode) error
- func ZipAndUploadFileInMultiplePartsToLightHouse(fileFolder string, baseDir string, apiKey string) (string, error)
- type FileDetail
- type FileInLightHouse
- type FileInfo
- type LightHouseResponse
Constants ¶
View Source
const (
IPFSGateway = "https://gateway.lighthouse.storage/ipfs/"
)
Variables ¶
View Source
var ( ZipChunkSize = 200 // MB BASH_EXEC = getBashExecutable() THREADS = runtime.NumCPU() - 1 )
Functions ¶
func DownloadToFile ¶
func UploadDataFileByUrl ¶
func UploadDataWithRetry ¶
Types ¶
type FileDetail ¶
type FileInLightHouse ¶
type FileInLightHouse struct { Name string `json:"name"` IsInserted bool `json:"is_inserted"` IsPart bool `json:"is_part"` CountPart int `json:"count_part"` Files []*FileDetail `json:"files"` }
func ZipAndUploadFileInMultiplePartsToLightHouseByUrl ¶
func ZipAndUploadFileInMultiplePartsToLightHouseByUrl(url string, baseDir string, apiKey string) (*FileInLightHouse, error)
type FileInfo ¶
type FileInfo struct { FileSizeInBytes string `json:"fileSizeInBytes"` Cid string `json:"cid"` Encryption bool `json:"encryption"` FileName string `json:"fileName"` MimeType bool `json:"mimeType"` TxHash string `json:"txHash"` Error struct { Code int `json:"code"` Message string `json:"message"` } `json:"error"` }
func GetFileInfo ¶
type LightHouseResponse ¶
Click to show internal directories.
Click to hide internal directories.