service

package
v0.0.0-...-9bec60d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UploadOK int = iota
	UploadHashComputingFailed
	UploadCancelled
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IService

type IService interface {
	Upload(context context.Context, ali IUploadAliView, req IUploadRequest) *UploadResponse
}

type IUploadAliView

type IUploadAliView interface {
	UploadFile(req *ali_drive.UploadFileRequest) bool
	GetAccessToken() string
}

type IUploadRequest

type IUploadRequest interface {
	Session() *ali_drive.UploadSession
	FileName() string

	Size() int64
	ChunkHint() int64
	ReadAt(pos, maxLen int64) io.Reader

	Done()
}

type MockService

type MockService struct {
	UploadHandler func(context context.Context, ali IUploadAliView, req IUploadRequest) *UploadResponse
}

func (*MockService) Upload

func (svc *MockService) Upload(context context.Context, ali IUploadAliView, req IUploadRequest) *UploadResponse

type UploadImpl

type UploadImpl struct {
	Logger *log.Logger
}

func (*UploadImpl) Upload

func (svc *UploadImpl) Upload(context context.Context, ali IUploadAliView, req IUploadRequest) *UploadResponse

type UploadResponse

type UploadResponse struct {
	Code int
	Err  error
}

Jump to

Keyboard shortcuts

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