uploader

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoNeedToUpload = errors.New("no need to upload")

Functions

This section is empty.

Types

type AliOssUploader

type AliOssUploader struct {
	DoctronUploader
}

func (*AliOssUploader) GetUploadElapsed

func (ins *AliOssUploader) GetUploadElapsed() time.Duration

func (*AliOssUploader) Upload

func (ins *AliOssUploader) Upload() (url string, err error)

type DoctronUploader

type DoctronUploader struct {
	UploadConfig
	// contains filtered or unexported fields
}

type DoctronUploaderFactory

type DoctronUploaderFactory interface {
	// contains filtered or unexported methods
}

type DoctronUploaderI

type DoctronUploaderI interface {
	Uploader
}

func NewDoctronUploader

func NewDoctronUploader(ctx context.Context, doctronType string, uc UploadConfig) DoctronUploaderI

new doctron

type MockUploader

type MockUploader struct {
	DoctronUploader
}

func (*MockUploader) GetUploadElapsed

func (ins *MockUploader) GetUploadElapsed() time.Duration

func (*MockUploader) Upload

func (ins *MockUploader) Upload() (url string, err error)

type UploadConfig

type UploadConfig struct {
	Key    string
	Stream []byte
}

type UploadFunc

type UploadFunc func(uc UploadConfig) (url string, err error)

type Uploader

type Uploader interface {
	Upload() (string, error)
	GetUploadElapsed() time.Duration
}

Jump to

Keyboard shortcuts

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