Versions in this module Expand all Collapse all v1 v1.5.2 Jul 16, 2023 v1.5.1 May 15, 2023 v1.5.0 Apr 22, 2023 Changes in this version + const DefaultPathPrefix + const FileError + const HostError + const PathError + const QINIU_DISABLE_CONFIG_HOT_RELOADING_ENV + const QINIU_ENV + const QINIU_MULTI_CLUSTER_ENV + var ErrCannotTransferBetweenDifferentClusters = errors.New("cannot transfer between different clusters") + var ErrUndefinedConfig = errors.New("undefined config") + var MaxContinuousFailureDuration = 1 * time.Minute + var MaxContinuousFailureTimes = 5 + var MaxFindHostsPrecent = 50 + func FileServer(root FileSystem) http.Handler + func ServeContent(w http.ResponseWriter, req *http.Request, name string, modtime time.Time, ...) + func ServeFile(w http.ResponseWriter, r *http.Request, name string) + func SetCacheDirectoryAndLoad(path string) error + func SetLogger(logger kodocli.Ilog) + func StartServer(cfg *Config) (*http.Server, error) + func StartSimulateErrorServer(_ *Config) + func WithCurrentConfigurable(f func(configurable Configurable)) + type ApiServer struct + func NewApiServer(c *Config) *ApiServer + func NewApiServerV2() *ApiServer + func (svr *ApiServer) GetLogicalAvailableSizes() (map[string]uint64, error) + type Config struct + Addr string + Ak string + ApiServerHosts []string + BatchConcurrency int + BatchSize int + Bucket string + Delete bool + DownPath string + IoHosts []string + PartSize int64 + RecycleBin string + RsHosts []string + RsfHosts []string + Sim bool + Sk string + UcHosts []string + UpConcurrency int + UpHosts []string + func Load(file string) (*Config, error) + type Configurable interface + type CopyKeyInput FromToKey + type CopyKeysError FromToKeyError + type DeleteKeysError SingleKeyError + type Dir string + func (d Dir) Open(name string) (File, error) + type Downloader struct + func NewDownloader(c *Config) *Downloader + func NewDownloaderV2() *Downloader + func (d *Downloader) DownloadBytes(key string) (data []byte, err error) + func (d *Downloader) DownloadCheck(key string) (l int64, err error) + func (d *Downloader) DownloadCheckList(ctx context.Context, keys []string) ([]*FileStat, error) + func (d *Downloader) DownloadFile(key, path string) (f *os.File, err error) + func (d *Downloader) DownloadRangeBytes(key string, offset, size int64) (l int64, data []byte, err error) + func (d *Downloader) DownloadRangeReader(key string, offset, size int64) (l int64, reader io.ReadCloser, err error) + func (d *Downloader) DownloadRaw(key string, headers http.Header) (*http.Response, error) + type File interface + Readdir func(count int) ([]os.FileInfo, error) + Stat func() (os.FileInfo, error) + type FileStat struct + Name string + Size int64 + type FileSystem interface + Open func(name string) (File, error) + type FromToKey struct + FromKey string + ToKey string + type FromToKeyError struct + Code int + Error string + FromKey string + ToKey string + type Lister struct + func NewLister(c *Config) *Lister + func NewListerV2() *Lister + func (l *Lister) Copy(fromKey, toKey string) error + func (l *Lister) CopyDirectory(srcDir, destDir string) (copyErrors []CopyKeysError, err error) + func (l *Lister) CopyKeys(input []CopyKeyInput) ([]*CopyKeysError, error) + func (l *Lister) Delete(key string) error + func (l *Lister) DeleteDirectory(dir string) (deleteErrors []DeleteKeysError, err error) + func (l *Lister) DeleteKeys(keys []string) ([]*DeleteKeysError, error) + func (l *Lister) ForceDelete(key string) error + func (l *Lister) ForceDeleteDirectory(dir string) (deleteErrors []DeleteKeysError, err error) + func (l *Lister) ForceDeleteKeys(keys []string) ([]*DeleteKeysError, error) + func (l *Lister) ListPrefix(prefix string) []string + func (l *Lister) ListStat(keys []string) []*FileStat + func (l *Lister) MoveDirectoryTo(srcDir, destDir, toBucket string) (moveErrors []MoveKeysError, err error) + func (l *Lister) MoveKeys(input []MoveKeyInput) ([]*MoveKeysError, error) + func (l *Lister) MoveTo(fromKey, toBucket, toKey string) error + func (l *Lister) Rename(fromKey, toKey string) error + func (l *Lister) RenameDirectory(srcDir, destDir string) (renameErrors []RenameKeysError, err error) + func (l *Lister) RenameKeys(input []RenameKeyInput) ([]*RenameKeysError, error) + type MoveKeyInput struct + ToBucket string + type MoveKeysError struct + ToBucket string + type MultiClustersConfig struct + func LoadMultiClusterConfigs(file string) (*MultiClustersConfig, error) + func (config *MultiClustersConfig) SetConfigSelectCallback(f func(configs map[string]*Config, key string) (*Config, bool)) + type Queryer struct + func NewQueryer(c *Config) *Queryer + func (queryer *Queryer) QueryApiServerHosts(https bool) (urls []string) + func (queryer *Queryer) QueryIoHosts(https bool) (urls []string) + func (queryer *Queryer) QueryRsHosts(https bool) (urls []string) + func (queryer *Queryer) QueryRsfHosts(https bool) (urls []string) + func (queryer *Queryer) QueryUpHosts(https bool) (urls []string) + type RenameKeyInput FromToKey + type RenameKeysError FromToKeyError + type Req struct + Delete *bool + Key string + Path string + type SingleClusterConfig = Config + type SingleKeyError struct + Code int + Error string + Name string + type Uploader struct + func NewUploader(c *Config) *Uploader + func NewUploaderV2() *Uploader + func (p *Uploader) Upload(file string, key string) (err error) + func (p *Uploader) UploadData(data []byte, key string) (err error) + func (p *Uploader) UploadDataReader(data io.ReaderAt, size int, key string) (err error) + func (p *Uploader) UploadReader(reader io.Reader, key string) (err error)