client

package
v0.0.0-...-c303a62 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliBlobstore

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

func New

func New(storageClient StorageClient) (AliBlobstore, error)

func (*AliBlobstore) Delete

func (client *AliBlobstore) Delete(object string) error

func (*AliBlobstore) Exists

func (client *AliBlobstore) Exists(object string) (bool, error)

func (*AliBlobstore) Get

func (client *AliBlobstore) Get(sourceObject string, destinationFilePath string) error

func (*AliBlobstore) Put

func (client *AliBlobstore) Put(sourceFilePath string, destinationObject string) error

func (*AliBlobstore) Sign

func (client *AliBlobstore) Sign(object string, action string, expiredInSec int64) (string, error)

type DefaultStorageClient

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

func (DefaultStorageClient) Delete

func (dsc DefaultStorageClient) Delete(
	object string,
) error

func (DefaultStorageClient) Download

func (dsc DefaultStorageClient) Download(
	sourceObject string,
	destinationFilePath string,
) error

func (DefaultStorageClient) Exists

func (dsc DefaultStorageClient) Exists(object string) (bool, error)

func (DefaultStorageClient) SignedUrlGet

func (dsc DefaultStorageClient) SignedUrlGet(
	object string,
	expiredInSec int64,
) (string, error)

func (DefaultStorageClient) SignedUrlPut

func (dsc DefaultStorageClient) SignedUrlPut(
	object string,
	expiredInSec int64,
) (string, error)

func (DefaultStorageClient) Upload

func (dsc DefaultStorageClient) Upload(
	sourceFilePath string,
	sourceFileMD5 string,
	destinationObject string,
) error

type StorageClient

type StorageClient interface {
	Upload(
		sourceFilePath string,
		sourceFileMD5 string,
		destinationObject string,
	) error

	Download(
		sourceObject string,
		destinationFilePath string,
	) error

	Delete(
		object string,
	) error

	Exists(
		object string,
	) (bool, error)

	SignedUrlPut(
		object string,
		expiredInSec int64,
	) (string, error)

	SignedUrlGet(
		object string,
		expiredInSec int64,
	) (string, error)
}

func NewStorageClient

func NewStorageClient(storageConfig config.AliStorageConfig) (StorageClient, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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