Documentation
¶
Index ¶
- Variables
- func GetUploadProgress[T any](driver driver.Driver, keys ...string) (state T, ok bool)
- func InitClient()
- func NewRestyClient() *resty.Client
- func SaveUploadProgress(driver driver.Driver, state any, keys ...string) bool
- func UploadToS3(ctx context.Context, args S3UploadArgs) error
- type Json
- type ReqCallback
- type S3UploadArgs
- type TokenResp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NoRedirectClient *resty.Client RestyClient *resty.Client HttpClient *http.Client )
View Source
var DefaultTimeout = time.Second * 30
View Source
var UploadStateCache = cache.NewMemCache(cache.WithShards[any](32))
storage upload progress, for upload recovery
View Source
var UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
Functions ¶
func GetUploadProgress ¶
An upload progress can only be made by one process alone, so here you need to get it and then delete it.
func InitClient ¶
func InitClient()
func NewRestyClient ¶
func SaveUploadProgress ¶
Save upload progress for 20 minutes
func UploadToS3 ¶
func UploadToS3(ctx context.Context, args S3UploadArgs) error
Types ¶
type ReqCallback ¶
type S3UploadArgs ¶
Click to show internal directories.
Click to hide internal directories.