drivers

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoStorage

type CoStorage struct {
	Client     *cos.Client
	BucketName string
	Domain     string
}

func NewCoStorage

func NewCoStorage(secretId, secretKey, region, bucketName, domain string) *CoStorage

func (*CoStorage) Delete

func (tfs *CoStorage) Delete(ctx context.Context, path string) error

func (*CoStorage) PrivateUrl

func (tfs *CoStorage) PrivateUrl(ctx context.Context, path string) (string, error)

func (*CoStorage) PublicUrl

func (tfs *CoStorage) PublicUrl(ctx context.Context, path string) (string, error)

func (*CoStorage) Read

func (tfs *CoStorage) Read(ctx context.Context, path string) (string, error)

func (*CoStorage) ReadStream

func (tfs *CoStorage) ReadStream(ctx context.Context, path string) (io.Reader, error)

func (*CoStorage) Write

func (tfs *CoStorage) Write(ctx context.Context, path string, contents string, config map[string]any) error

func (*CoStorage) WriteStream

func (tfs *CoStorage) WriteStream(ctx context.Context, path string, stream io.Reader, config map[string]any) error

type LocalStorage

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

func NewLocalStorage

func NewLocalStorage(root string, domain string) *LocalStorage

func (*LocalStorage) Delete

func (s *LocalStorage) Delete(ctx context.Context, path string) error

func (*LocalStorage) PrivateUrl

func (s *LocalStorage) PrivateUrl(ctx context.Context, path string) (string, error)

func (*LocalStorage) PublicUrl

func (s *LocalStorage) PublicUrl(ctx context.Context, path string) (string, error)

func (*LocalStorage) Read

func (s *LocalStorage) Read(ctx context.Context, path string) (string, error)

func (*LocalStorage) ReadStream

func (s *LocalStorage) ReadStream(ctx context.Context, path string) (io.Reader, error)

func (*LocalStorage) Write

func (s *LocalStorage) Write(ctx context.Context, path string, contents string, config map[string]interface{}) error

func (*LocalStorage) WriteStream

func (s *LocalStorage) WriteStream(ctx context.Context, path string, stream io.Reader, config map[string]interface{}) error

type ObsStorage added in v1.0.1

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

func NewObsStorage added in v1.0.1

func NewObsStorage(ak string, sk string, endpoint string, bucketName string, publicUrl string) *ObsStorage

func (*ObsStorage) Delete added in v1.0.1

func (h *ObsStorage) Delete(ctx context.Context, path string) error

func (*ObsStorage) PrivateUrl added in v1.0.1

func (h *ObsStorage) PrivateUrl(ctx context.Context, path string) (string, error)

func (*ObsStorage) PublicUrl added in v1.0.1

func (h *ObsStorage) PublicUrl(ctx context.Context, path string) (string, error)

func (*ObsStorage) Read added in v1.0.1

func (h *ObsStorage) Read(ctx context.Context, path string) (string, error)

func (*ObsStorage) ReadStream added in v1.0.1

func (h *ObsStorage) ReadStream(ctx context.Context, path string) (io.Reader, error)

func (*ObsStorage) Write added in v1.0.1

func (h *ObsStorage) Write(ctx context.Context, path string, contents string, config map[string]interface{}) error

func (*ObsStorage) WriteStream added in v1.0.1

func (h *ObsStorage) WriteStream(ctx context.Context, path string, stream io.Reader, config map[string]interface{}) error

type OssStorage

type OssStorage struct {
	Client     *oss.Client
	Domain     string
	BucketName string
}

func NewOssStorage

func NewOssStorage(accessKeyId, accessKeySecret, endpoint, bucketName, domain string) *OssStorage

func (*OssStorage) Delete

func (ofs *OssStorage) Delete(ctx context.Context, path string) error

func (*OssStorage) PrivateUrl

func (ofs *OssStorage) PrivateUrl(ctx context.Context, path string) (string, error)

func (*OssStorage) PublicUrl

func (ofs *OssStorage) PublicUrl(ctx context.Context, path string) (string, error)

func (*OssStorage) Read

func (ofs *OssStorage) Read(ctx context.Context, path string) (string, error)

func (*OssStorage) ReadStream

func (ofs *OssStorage) ReadStream(ctx context.Context, path string) (io.Reader, error)

func (*OssStorage) Write

func (ofs *OssStorage) Write(ctx context.Context, path string, contents string, config map[string]interface{}) error

func (*OssStorage) WriteStream

func (ofs *OssStorage) WriteStream(ctx context.Context, path string, stream io.Reader, config map[string]interface{}) error

type QiniuFileStorage

type QiniuFileStorage struct {
	Bucket string
	Domain string
	Mac    *qbox.Mac
}

func NewQiniuStorage

func NewQiniuStorage(Bucket, AccessKey, SecretKey, Domain string) *QiniuFileStorage

func (*QiniuFileStorage) Delete

func (qfs *QiniuFileStorage) Delete(ctx context.Context, path string) error

func (*QiniuFileStorage) PrivateUrl

func (qfs *QiniuFileStorage) PrivateUrl(ctx context.Context, path string) (string, error)

func (*QiniuFileStorage) PublicUrl

func (qfs *QiniuFileStorage) PublicUrl(ctx context.Context, path string) (string, error)

func (*QiniuFileStorage) Read

func (qfs *QiniuFileStorage) Read(ctx context.Context, path string) (string, error)

func (*QiniuFileStorage) ReadStream

func (qfs *QiniuFileStorage) ReadStream(ctx context.Context, path string) (io.Reader, error)

func (*QiniuFileStorage) Write

func (qfs *QiniuFileStorage) Write(ctx context.Context, path string, contents string, config map[string]any) error

func (*QiniuFileStorage) WriteStream

func (qfs *QiniuFileStorage) WriteStream(ctx context.Context, path string, stream io.Reader, config map[string]any) error

Jump to

Keyboard shortcuts

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