pkg

package
v3.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: Apache-2.0 Imports: 23 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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