storage

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStorageProvider

func GetStorageProvider(providerType string, clientId string, clientSecret string, region string, bucket string, endpoint string, cert string, content string) (oss.StorageInterface, error)

func NewAliyunOssStorageProvider

func NewAliyunOssStorageProvider(clientId string, clientSecret string, region string, bucket string, endpoint string) oss.StorageInterface

func NewAwsS3StorageProvider

func NewAwsS3StorageProvider(clientId string, clientSecret string, region string, bucket string, endpoint string) oss.StorageInterface

func NewAzureBlobStorageProvider

func NewAzureBlobStorageProvider(clientId string, clientSecret string, region string, bucket string, endpoint string) oss.StorageInterface

func NewCasdoorStorageProvider

func NewCasdoorStorageProvider(providerType string, clientId string, clientSecret string, region string, bucket string, endpoint string, cert string, content string) oss.StorageInterface

func NewGoogleCloudStorageProvider

func NewGoogleCloudStorageProvider(clientSecret string, bucket string, endpoint string) oss.StorageInterface

func NewMinIOS3StorageProvider

func NewMinIOS3StorageProvider(clientId string, clientSecret string, region string, bucket string, endpoint string) oss.StorageInterface

func NewQiniuCloudKodoStorageProvider

func NewQiniuCloudKodoStorageProvider(clientId string, clientSecret string, region string, bucket string, endpoint string) (oss.StorageInterface, error)

func NewSynologyNasStorageProvider

func NewSynologyNasStorageProvider(clientId string, clientSecret string, endpoint string) oss.StorageInterface

func NewTencentCloudCosStorageProvider

func NewTencentCloudCosStorageProvider(clientId string, clientSecret string, region string, bucket string, endpoint string) oss.StorageInterface

Types

type LocalFileSystemProvider

type LocalFileSystemProvider struct {
	BaseDir string
}

LocalFileSystemProvider file system storage

func NewLocalFileSystemStorageProvider

func NewLocalFileSystemStorageProvider() *LocalFileSystemProvider

NewLocalFileSystemStorageProvider initialize the local file system storage

func (LocalFileSystemProvider) Delete

func (sp LocalFileSystemProvider) Delete(path string) error

Delete delete file

func (LocalFileSystemProvider) Get

func (sp LocalFileSystemProvider) Get(path string) (*os.File, error)

Get receive file with given path

func (LocalFileSystemProvider) GetEndpoint

func (sp LocalFileSystemProvider) GetEndpoint() string

GetEndpoint get endpoint, LocalFileSystemProvider's endpoint is /

func (LocalFileSystemProvider) GetFullPath

func (sp LocalFileSystemProvider) GetFullPath(path string) string

GetFullPath get full path from absolute/relative path

func (LocalFileSystemProvider) GetStream

func (sp LocalFileSystemProvider) GetStream(path string) (io.ReadCloser, error)

GetStream get file as stream

func (LocalFileSystemProvider) GetURL

func (sp LocalFileSystemProvider) GetURL(path string) (url string, err error)

GetURL get public accessible URL

func (LocalFileSystemProvider) List

func (sp LocalFileSystemProvider) List(path string) ([]*oss.Object, error)

List list all objects under current path

func (LocalFileSystemProvider) Put

func (sp LocalFileSystemProvider) Put(path string, reader io.Reader) (*oss.Object, error)

Put store a reader into given path

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳