arweave

package
v0.0.0-...-8f28ad5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package arweave is a wrapper for the Arweave client.

Index

Constants

View Source
const AkrodAPI = "https://api.akord.com/files"

AkrodAPI akord api

Variables

View Source
var DataPrefixEnabledGz = []byte("gz::")

Functions

func CompressData

func CompressData(data []byte) ([]byte, error)

CompressData compress data if it's larger than 1KB

func DecompressData

func DecompressData(data []byte) ([]byte, error)

DecompressData decompress data if it's compressed

Types

type Akord

type Akord struct {
	// contains filtered or unexported fields
}

Akord akord uploader

func NewAkrod

func NewAkrod(apis []string) *Akord

NewAkrod create a new akord uploader

func (*Akord) Upload

func (a *Akord) Upload(ctx context.Context,
	data []byte, opts ...UploadOption) (fileID string, err error)

Upload upload data to akord

type AkrodUploadFileResp

type AkrodUploadFileResp struct {
	Tx struct {
		Id string `json:"id"`
	} `json:"tx"`
}

AkrodUploadFileResp response of akord upload file

type Ardrive

type Ardrive struct {
	// contains filtered or unexported fields
}

func NewArdrive

func NewArdrive(walletPath string, folder string) *Ardrive

func (*Ardrive) Upload

func (a *Ardrive) Upload(ctx context.Context,
	data []byte, opts ...UploadOption) (fileID string, err error)

type UploadOption

type UploadOption func(*uploadOption) error

func WithContentType

func WithContentType(contentType string) UploadOption

WithContentType set content type

func WithGzip

func WithGzip() UploadOption

WithGzip enable gzip

Jump to

Keyboard shortcuts

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