base

package
v4.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = time.Second * 30
View Source
const UserAgent = "Mozilla/5.0 (Macintosh; Apple macOS 15_5) AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36 Chrome/138.0.0.0"

Variables

View Source
var (
	NoRedirectClient *resty.Client
	RestyClient      *resty.Client
	HttpClient       *http.Client
)
View Source
var UploadStateCache = cache.NewMemCache(cache.WithShards[any](32))

UploadStateCache storage upload progress, for upload recovery

Functions

func GetUploadProgress

func GetUploadProgress[T any](driver driver.Driver, keys ...string) (state T, ok bool)

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 NewRestyClient() *resty.Client

func SaveUploadProgress

func SaveUploadProgress(driver driver.Driver, state any, keys ...string) bool

SaveUploadProgress Save upload progress for 20 minutes

Types

type Json

type Json map[string]any

type ReqCallback

type ReqCallback func(req *resty.Request)

type TokenResp

type TokenResp struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

Jump to

Keyboard shortcuts

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