qiniu

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	urlhandler.Handler
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config) (*Client, error)

func (*Client) CopyFile

func (n *Client) CopyFile(ctx context.Context, sourceKey string, destinationKey string, overwrite bool) error

func (*Client) DeleteFile

func (n *Client) DeleteFile(ctx context.Context, key string) error

func (*Client) DownloadFile

func (n *Client) DownloadFile(ctx context.Context, key string) (io.ReadCloser, string, int64, error)

func (*Client) GenerateImageURL

func (n *Client) GenerateImageURL(key string, width int) string

func (*Client) GenerateUploadToken

func (n *Client) GenerateUploadToken(ctx context.Context, fileName string, dir string, nameBuilder func(fileName string, dir ...string) string) ([3]string, error)

func (*Client) IsFileExists

func (n *Client) IsFileExists(ctx context.Context, key string) (bool, error)

func (*Client) MoveFile

func (n *Client) MoveFile(ctx context.Context, sourceKey string, destinationKey string, overwrite bool) error

func (*Client) UploadFile

func (n *Client) UploadFile(ctx context.Context, file io.Reader, key string) (string, error)

func (*Client) UploadLocalFile

func (n *Client) UploadLocalFile(ctx context.Context, file string, key string) (string, error)

type Config

type Config struct {
	AccessKey string `json:"access_key" yaml:"access_key"`
	SecretKey string `json:"secret_key" yaml:"secret_key"`

	Bucket string `json:"bucket" yaml:"bucket"`
	Dir    string `json:"dir" yaml:"dir"`

	PublicBase string `json:"public_base" yaml:"public_base"`
}

Jump to

Keyboard shortcuts

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