pkg

package
v3.8.3-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRequestHeader

func DefaultRequestHeader(header http.Header)

func Run

func Run(conf Config) error

Types

type Api

type Api struct {
	Api    string
	UserID string
	Secret string
	Token  string
	Client *http.Client
}

func (*Api) CompleteMultipartUpload

func (a *Api) CompleteMultipartUpload(ctx context.Context, req *third.CompleteMultipartUploadReq) (string, error)

func (*Api) GetAdminToken added in v3.8.1

func (a *Api) GetAdminToken(ctx context.Context) (string, error)

func (*Api) GetPartLimit

func (a *Api) GetPartLimit(ctx context.Context) (*third.PartLimitResp, error)

type Config

type Config struct {
	TaskPath     string
	ProgressPath string
	Concurrency  int
	Retry        int
	Timeout      time.Duration
	Api          string
	UserID       string
	Secret       string
	TempDir      string
	CacheSize    int64
}

type Manage

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

func (*Manage) HttpGet

func (m *Manage) HttpGet(ctx context.Context, url string) (*http.Response, error)

func (*Manage) Run

func (m *Manage) Run() error

func (*Manage) RunTask

func (m *Manage) RunTask(ctx context.Context, task Task) (string, error)

type Md5Reader

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

func NewMd5Reader

func NewMd5Reader(r io.Reader) *Md5Reader

func (*Md5Reader) Md5

func (r *Md5Reader) Md5() string

func (*Md5Reader) Read

func (r *Md5Reader) Read(p []byte) (n int, err error)

type PartInfo

type PartInfo struct {
	ContentType string
	PartSize    int64
	PartNum     int
	FileMd5     string
	PartMd5     string
	PartSizes   []int64
	PartMd5s    []string
}

type Progress

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

func ReadProgress

func ReadProgress(path string) (*Progress, error)

func (*Progress) IsUploaded

func (p *Progress) IsUploaded(index int) bool

type ReadSeekSizeCloser

type ReadSeekSizeCloser interface {
	io.ReadSeekCloser
	Size() int64
}

func NewReader

func NewReader(r io.Reader, max int64, path string) (ReadSeekSizeCloser, error)

type Task

type Task struct {
	Index  int
	Upload Upload
}

type Upload

type Upload struct {
	URL         string `json:"url"`
	Name        string `json:"name"`
	ContentType string `json:"contentType"`
}

Jump to

Keyboard shortcuts

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