uploader

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegsiterDriver

func RegsiterDriver(name string, uploader Uploader, uploaderConfig UploaderConfig)

Types

type AccessToken

type AccessToken struct {
	AccessToken string    `json:"accessToken"`
	ExpiredAt   time.Time `json:"expiredAt"`
}

type CreateFileResult

type CreateFileResult struct {
	FileID      int    `json:"fileID"`
	PreuploadID string `json:"preuploadID"`
	Reuse       bool   `json:"reuse"`
	SliceSize   int    `json:"sliceSize"`
}

type DirInfo

type DirInfo struct {
	DirID int `json:"dirID"`
}

type FileItem

type FileItem struct {
	FileID       int    `json:"fileID"`
	FileName     string `json:"filename"`
	Type         int    `json:"type"`
	ParentFileId int    `json:"parentFileId"`
}

type FileListData

type FileListData struct {
	Total    int         `json:"total"`
	FileList []*FileItem `json:"fileList"`
}

type FilePart

type FilePart struct {
	PartNumber string `json:"partNumber"`
	Size       int    `json:"size"`
	Etag       string `json:"etag"`
}

type FileParts

type FileParts struct {
	Parts []*FilePart `json:"parts"`
}

type ImageHostingCFWorkersUploader

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

func (*ImageHostingCFWorkersUploader) GetDownloadUrl

func (u *ImageHostingCFWorkersUploader) GetDownloadUrl(path string) (string, error)

func (*ImageHostingCFWorkersUploader) GetUploadUrl

func (u *ImageHostingCFWorkersUploader) GetUploadUrl(path string) (string, error)

func (*ImageHostingCFWorkersUploader) InitUploader

func (u *ImageHostingCFWorkersUploader) InitUploader(c *echo.Group) error

func (*ImageHostingCFWorkersUploader) Put

func (u *ImageHostingCFWorkersUploader) Put(path string, data []byte) error

type ImageHostingCFWorkersUploaderConfig

type ImageHostingCFWorkersUploaderConfig struct {
	Url      string `json:"url"`
	SignKey  string `json:"signkey"`
	R2Domain string `json:"r2domain"`
}

type LocalFileSignJWTClaims

type LocalFileSignJWTClaims struct {
	Path string `json:"path"`
	jwt.StandardClaims
}

type LocalUploader

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

func (*LocalUploader) GetDownloadUrl

func (u *LocalUploader) GetDownloadUrl(path string) (string, error)

func (*LocalUploader) GetUploadUrl

func (u *LocalUploader) GetUploadUrl(path string) (string, error)

func (*LocalUploader) InitUploader

func (u *LocalUploader) InitUploader(c *echo.Group) error

func (*LocalUploader) Put

func (u *LocalUploader) Put(savepath string, data []byte) error

type LocalUploaderConfig

type LocalUploaderConfig struct {
	Root       string `json:"root"`
	Fileserver string `json:"fileserver"`
}

type OpenApiResp

type OpenApiResp struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type PreUploadUrlResp

type PreUploadUrlResp struct {
	PresignedURL string `json:"presignedURL"`
}

type RemoteUploader

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

func (*RemoteUploader) GetDownloadUrl

func (u *RemoteUploader) GetDownloadUrl(path string) (string, error)

func (*RemoteUploader) GetUploadUrl

func (u *RemoteUploader) GetUploadUrl(path string) (string, error)

func (*RemoteUploader) InitUploader

func (u *RemoteUploader) InitUploader(c *echo.Group) error

func (*RemoteUploader) Put

func (u *RemoteUploader) Put(path string, data []byte) error

type RemoteUploaderConfig

type RemoteUploaderConfig struct {
	Url        string `json:"url"`
	Secret     string `json:"secret"`
	Fileserver string `json:"fileserver"`
}

type S3Uploader

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

func (*S3Uploader) GetDownloadUrl

func (u *S3Uploader) GetDownloadUrl(path string) (string, error)

func (*S3Uploader) GetUploadUrl

func (u *S3Uploader) GetUploadUrl(path string) (string, error)

func (*S3Uploader) InitUploader

func (u *S3Uploader) InitUploader(c *echo.Group) error

func (*S3Uploader) Put

func (u *S3Uploader) Put(path string, data []byte) error

type S3UploaderConfig

type S3UploaderConfig struct {
	SecretID    string `json:"secretId"`
	SecretKey   string `json:"secretKey"`
	Region      string `json:"region"`
	Endpoint    string `json:"endpoint"`
	Bucket      string `json:"bucket"`
	VirutalHost string `json:"virutalHost"`
	Domain      string `json:"domain"`
	Pkey        string `json:"pkey"`
}

type UploadAsyncResultResp

type UploadAsyncResultResp struct {
	FileID    int  `json:"fileID"`
	Completed bool `json:"completed"`
}

type UploadCompleteResp

type UploadCompleteResp struct {
	FileID    int  `json:"fileID"`
	Async     bool `json:"async"`
	Completed bool `json:"completed"`
}

type Uploader

type Uploader interface {
	InitUploader(c *echo.Group) error

	GetUploadUrl(path string) (string, error)

	GetDownloadUrl(path string) (string, error)

	Put(path string, data []byte) error
	// contains filtered or unexported methods
}

func NewUploader

func NewUploader(name string, config map[string]string) Uploader

type UploaderConfig

type UploaderConfig interface {
}

type YunPan123OpenAPIUploader

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

func (*YunPan123OpenAPIUploader) GetDownloadUrl

func (y *YunPan123OpenAPIUploader) GetDownloadUrl(path string) (string, error)

func (*YunPan123OpenAPIUploader) GetUploadUrl

func (y *YunPan123OpenAPIUploader) GetUploadUrl(path string) (string, error)

func (*YunPan123OpenAPIUploader) InitUploader

func (y *YunPan123OpenAPIUploader) InitUploader(c *echo.Group) error

func (*YunPan123OpenAPIUploader) Put

func (y *YunPan123OpenAPIUploader) Put(savepath string, data []byte) error

type YunPan123OpenAPIUploaderConfig

type YunPan123OpenAPIUploaderConfig struct {
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
	DlZone       string `json:"dlzone"`
	Uid          string `json:"uid"`
	SignKey      string `json:"signKey"`
	SignTime     string `json:"signTime"`
}

type YunPan123Uploader

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

func (*YunPan123Uploader) GetDownloadUrl

func (y *YunPan123Uploader) GetDownloadUrl(path string) (string, error)

func (*YunPan123Uploader) GetUploadUrl

func (y *YunPan123Uploader) GetUploadUrl(path string) (string, error)

func (*YunPan123Uploader) InitUploader

func (y *YunPan123Uploader) InitUploader(c *echo.Group) error

func (*YunPan123Uploader) Put

func (y *YunPan123Uploader) Put(path string, data []byte) error

type YunPan123UploaderConfig

type YunPan123UploaderConfig struct {
	Address  string `json:"address"`
	User     string `json:"user"`
	Password string `json:"password"`
	DLZone   string `json:"dlzone"`
	Uid      string `json:"uid"`
	SignKey  string `json:"signKey"`
	SignTime string `json:"signTime"`
}

Jump to

Keyboard shortcuts

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