upload

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(h Handler) *Client

func (*Client) Abort

func (cli *Client) Abort()

func (*Client) Release

func (cli *Client) Release()

func (*Client) Upload

func (cli *Client) Upload(url, jobID string, form form.FormData) error

func (*Client) WithCredentials

func (cli *Client) WithCredentials(flag bool)

type Handler

type Handler interface {
	Progress(jobID string, state ProgressState, loaded, total uint64)
	Completed(resp *xhr.Response, err error)
}

type ProgressFunc

type ProgressFunc func(string, ProgressState, uint64, uint64)

type ProgressState

type ProgressState int
const (
	StateStart    ProgressState = 1
	StateProgress ProgressState = 2
	StateFinish   ProgressState = 3
)

func (ProgressState) String

func (s ProgressState) String() string

Jump to

Keyboard shortcuts

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