Documentation ¶
Index ¶
- type Client
- func (i *Client) BasicUpload(ctx context.Context, file io.Reader, tags ...types.Tag) (types.Transaction, error)
- func (i *Client) ChunkUpload(ctx context.Context, file io.Reader, price *big.Int, tags ...types.Tag) (types.Transaction, error)
- func (i *Client) Download(ctx context.Context, hash string) (*types.File, error)
- func (i *Client) GetBalance(ctx context.Context) (*big.Int, error)
- func (i *Client) GetMetaData(ctx context.Context, hash string) (types.Transaction, error)
- func (i *Client) GetPrice(ctx context.Context, fileSize int) (*big.Int, error)
- func (i *Client) TopUpBalance(ctx context.Context, amount *big.Int) (types.TopUpConfirmation, error)
- func (i *Client) Upload(ctx context.Context, file io.Reader, price *big.Int, tags ...types.Tag) (types.Transaction, error)
- type Irys
- type Node
- type Option
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.5.1
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BasicUpload ¶ added in v0.5.1
func (*Client) ChunkUpload ¶ added in v0.5.1
func (*Client) GetBalance ¶ added in v0.5.1
func (*Client) GetMetaData ¶ added in v0.5.1
func (*Client) TopUpBalance ¶ added in v0.5.1
type Irys ¶
type Irys interface { // GetPrice return fee base on fileSize in byte for selected currency GetPrice(ctx context.Context, fileSize int) (*big.Int, error) // BasicUpload file with calculate price and topUp balance base on price (this is slower for upload) BasicUpload(ctx context.Context, file io.Reader, tags ...types.Tag) (types.Transaction, error) // Upload file with check balance Upload(ctx context.Context, file io.Reader, price *big.Int, tags ...types.Tag) (types.Transaction, error) // ChunkUpload upload file chunk concurrent ChunkUpload(ctx context.Context, file io.Reader, price *big.Int, tags ...types.Tag) (types.Transaction, error) // Download get file with header details Download(ctx context.Context, hash string) (*types.File, error) // GetMetaData get transaction details GetMetaData(ctx context.Context, hash string) (types.Transaction, error) // GetBalance return current balance in irys node GetBalance(ctx context.Context) (*big.Int, error) // TopUpBalance top up your balance base on your amount in selected node TopUpBalance(ctx context.Context, amount *big.Int) (types.TopUpConfirmation, error) }
func New ¶
New create IrysClient object
Example ¶
matic, err := currency.NewMatic("foo", "bar") if err != nil { log.Fatal(err) } c, err := New(DefaultNode1, matic, false) if err != nil { log.Fatal(err) } p, err := c.GetPrice(context.Background(), 100000) if err != nil { log.Fatal(err) } fmt.Println(p.Int64())
Output:
type Option ¶
type Option func(irys *Client)
func WithCustomClient ¶
WithCustomClient set custom http client for irys
func WithCustomLogging ¶ added in v0.5.1
WithCustomLogging create custom logging
func WithCustomRetryMax ¶ added in v0.4.0
WithCustomRetryMax maximum number of retries
func WithCustomRetryWaitMax ¶ added in v0.4.0
WithCustomRetryWaitMax maximum time to wait
func WithCustomRetryWaitMin ¶ added in v0.4.0
WithCustomRetryWaitMin minimum time to wait
Click to show internal directories.
Click to hide internal directories.