Documentation ¶
Index ¶
- func GetConfigType(config Config) (cfg interface{})
- type CloudStore
- func (c *CloudStore) Delete(objects ...string) (err error)
- func (c *CloudStore) GetPublicDomain() (domain string)
- func (c *CloudStore) GetSignURL(object string) (link string)
- func (c *CloudStore) IsExist(object string) (err error)
- func (c *CloudStore) Lists(object string) (files []cloud.File, err error)
- func (c *CloudStore) PingTest() (err error)
- func (c *CloudStore) Upload(tmpFile, saveFile string, headers ...map[string]string) (err error)
- type Config
- type ConfigBos
- type ConfigCos
- type ConfigMinio
- type ConfigObs
- type ConfigOss
- type ConfigQiniu
- type ConfigUpYun
- type StoreType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigType ¶
func GetConfigType(config Config) (cfg interface{})
Types ¶
type CloudStore ¶
type CloudStore struct { Private bool StoreType StoreType CanGZIP bool Client interface{} Config interface{} Expire int64 PublicDomain string PrivateDomain string }
func NewCloudStore ¶
func NewCloudStore(storeConf Config, private bool) (cs *CloudStore, err error)
创建云存储 config 相应存储的struct指针 storetype 云存储对应的名字 private false不使用普通网络
func NewCloudStoreWithConfig ¶
func NewCloudStoreWithConfig(storeConfig interface{}, storeType StoreType, private bool) (cs *CloudStore, err error)
func (*CloudStore) Delete ¶
func (c *CloudStore) Delete(objects ...string) (err error)
func (*CloudStore) GetPublicDomain ¶
func (c *CloudStore) GetPublicDomain() (domain string)
func (*CloudStore) GetSignURL ¶
func (c *CloudStore) GetSignURL(object string) (link string)
func (*CloudStore) IsExist ¶
func (c *CloudStore) IsExist(object string) (err error)
err 返回 nil,表示文件存在,否则表示文件不存在
func (*CloudStore) Lists ¶
func (c *CloudStore) Lists(object string) (files []cloud.File, err error)
func (*CloudStore) PingTest ¶
func (c *CloudStore) PingTest() (err error)
type ConfigBos ¶
type ConfigBos struct { AccessKey string `store:"access-key" fieldName:"AccessKey"` SecretKey string `store:"secret-key" fieldName:"SecretKey"` Endpoint string `store:"endpoint" fieldName:"Endpoint"` PublicBucket string `store:"public-bucket" fieldName:"PublicBucket"` PublicBucketDomain string `store:"public-bucket-domain" fieldName:"PublicBucketDomain"` PrivateBucket string `store:"private-bucket" fieldName:"PrivateBucket"` PrivateBucketDomain string `store:"private-bucket-domain" fieldName:"PrivateBucketDomain"` Expire int64 `store:"expire" fieldName:"Expire"` }
type ConfigCos ¶
type ConfigCos struct { AccessKey string `store:"access-key" fieldName:"AccessKey"` SecretKey string `store:"secret-key" fieldName:"SecretKey"` Region string `store:"region" fieldName:"Region"` AppId string `store:"app-id" fieldName:"AppId"` PublicBucket string `store:"public-bucket" fieldName:"PublicBucket"` PublicBucketDomain string `store:"public-bucket-domain" fieldName:"PublicBucketDomain"` PrivateBucket string `store:"private-bucket" fieldName:"PrivateBucket"` PrivateBucketDomain string `store:"private-bucket-domain" fieldName:"PrivateBucketDomain"` Expire int64 `store:"expire" fieldName:"Expire"` }
type ConfigMinio ¶
type ConfigMinio struct { AccessKey string `store:"access-key" fieldName:"AccessKey"` SecretKey string `store:"secret-key" fieldName:"SecretKey"` Endpoint string `store:"endpoint" fieldName:"Endpoint"` PublicBucket string `store:"public-bucket" fieldName:"PublicBucket"` PublicBucketDomain string `store:"public-bucket-domain" fieldName:"PublicBucketDomain"` PrivateBucket string `store:"private-bucket" fieldName:"PrivateBucket"` PrivateBucketDomain string `store:"private-bucket-domain" fieldName:"PrivateBucketDomain"` Expire int64 `store:"expire" fieldName:"Expire"` }
type ConfigObs ¶
type ConfigObs struct { AccessKey string `store:"access-key" fieldName:"AccessKey"` SecretKey string `store:"secret-key" fieldName:"SecretKey"` Endpoint string `store:"endpoint" fieldName:"Endpoint"` PublicBucket string `store:"public-bucket" fieldName:"PublicBucket"` PublicBucketDomain string `store:"public-bucket-domain" fieldName:"PublicBucketDomain"` PrivateBucket string `store:"private-bucket" fieldName:"PrivateBucket"` PrivateBucketDomain string `store:"private-bucket-domain" fieldName:"PrivateBucketDomain"` Expire int64 `store:"expire" fieldName:"Expire"` }
type ConfigOss ¶
type ConfigOss struct { AccessKey string `store:"access-key" fieldName:"AccessKey"` SecretKey string `store:"secret-key" fieldName:"SecretKey"` Endpoint string `store:"endpoint" fieldName:"Endpoint"` PublicBucket string `store:"public-bucket" fieldName:"PublicBucket"` PublicBucketDomain string `store:"public-bucket-domain" fieldName:"PublicBucketDomain"` PrivateBucket string `store:"private-bucket" fieldName:"PrivateBucket"` PrivateBucketDomain string `store:"private-bucket-domain" fieldName:"PrivateBucketDomain"` Expire int64 `store:"expire" fieldName:"Expire"` }
type ConfigQiniu ¶
type ConfigQiniu struct { AccessKey string `store:"access-key" fieldName:"AccessKey"` SecretKey string `store:"secret-key" fieldName:"SecretKey"` Endpoint string `store:"endpoint" fieldName:"Endpoint"` PublicBucket string `store:"public-bucket" fieldName:"PublicBucket"` PublicBucketDomain string `store:"public-bucket-domain" fieldName:"PublicBucketDomain"` PrivateBucket string `store:"private-bucket" fieldName:"PrivateBucket"` PrivateBucketDomain string `store:"private-bucket-domain" fieldName:"PrivateBucketDomain"` Expire int64 `store:"expire" fieldName:"Expire"` }
type ConfigUpYun ¶
type ConfigUpYun struct { AccessKey string `store:"access-key" fieldName:"AccessKey"` SecretKey string `store:"secret-key" fieldName:"SecretKey"` Endpoint string `store:"endpoint" fieldName:"Endpoint"` PublicBucket string `store:"public-bucket" fieldName:"PublicBucket"` PublicBucketDomain string `store:"public-bucket-domain" fieldName:"PublicBucketDomain"` PrivateBucket string `store:"private-bucket" fieldName:"PrivateBucket"` PrivateBucketDomain string `store:"private-bucket-domain" fieldName:"PrivateBucketDomain"` Expire int64 `store:"expire" fieldName:"Expire"` }
Click to show internal directories.
Click to hide internal directories.