oss

package
v0.9.98 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderAmazonOSS = 2
View Source
const ProviderGoogleOSS = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type AmazonOSS added in v0.9.24

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

func NewAmazonOSS added in v0.9.24

func NewAmazonOSS(configService config.IConfig, clockService clock.IClock, bucketsMapping map[string]*Bucket, env string) (*AmazonOSS, error)

func (*AmazonOSS) CreateObjectFromKey added in v0.9.24

func (ossStorage *AmazonOSS) CreateObjectFromKey(ormService *beeorm.Engine, bucket, key string) Object

func (*AmazonOSS) DeleteObject added in v0.9.24

func (ossStorage *AmazonOSS) DeleteObject(bucket string, object *Object) error

func (*AmazonOSS) GetClient added in v0.9.24

func (ossStorage *AmazonOSS) GetClient() interface{}

func (*AmazonOSS) GetObjectBase64Content added in v0.9.24

func (ossStorage *AmazonOSS) GetObjectBase64Content(_ string, _ *Object) (string, error)

func (*AmazonOSS) GetObjectCDNURL added in v0.9.24

func (ossStorage *AmazonOSS) GetObjectCDNURL(bucket string, object *Object) (string, error)

func (*AmazonOSS) GetObjectOSSURL added in v0.9.24

func (ossStorage *AmazonOSS) GetObjectOSSURL(_ string, _ *Object) (string, error)

func (*AmazonOSS) GetObjectSignedURL added in v0.9.24

func (ossStorage *AmazonOSS) GetObjectSignedURL(bucket string, object *Object, expires time.Time) (string, error)

func (*AmazonOSS) GetObjectURL added in v0.9.24

func (ossStorage *AmazonOSS) GetObjectURL(bucket string, object *Object) (string, error)

func (*AmazonOSS) GetUploaderBucketConfig added in v0.9.37

func (ossStorage *AmazonOSS) GetUploaderBucketConfig() *BucketConfig

func (*AmazonOSS) UploadImageFromBase64 added in v0.9.24

func (ossStorage *AmazonOSS) UploadImageFromBase64(ormService *beeorm.Engine, bucket, path, image, extension string) (Object, error)

func (*AmazonOSS) UploadImageFromFile added in v0.9.24

func (ossStorage *AmazonOSS) UploadImageFromFile(ormService *beeorm.Engine, bucket, path, localFile string) (Object, error)

func (*AmazonOSS) UploadObjectFromBase64 added in v0.9.24

func (ossStorage *AmazonOSS) UploadObjectFromBase64(ormService *beeorm.Engine, bucket, path, content, extension string) (Object, error)

func (*AmazonOSS) UploadObjectFromByte added in v0.9.24

func (ossStorage *AmazonOSS) UploadObjectFromByte(ormService *beeorm.Engine, bucket, path string, objectContent []byte, extension string) (Object, error)

func (*AmazonOSS) UploadObjectFromFile added in v0.9.24

func (ossStorage *AmazonOSS) UploadObjectFromFile(ormService *beeorm.Engine, bucket, path, localFile string) (Object, error)

type Bucket added in v0.9.72

type Bucket struct {
	ID    uint64
	Paths []string
}

type BucketConfig added in v0.9.24

type BucketConfig struct {
	Name   string
	CDNURL string
}

type Buckets added in v0.9.24

type Buckets struct {
	Mapping map[string]*Bucket
	Configs map[string]map[string]*BucketConfig
}

type CachedObjectURLTemplate added in v0.9.24

type CachedObjectURLTemplate struct {
	Environment string
	BucketName  string
	StorageKey  string
	CounterID   string
}

type GoogleOSS added in v0.9.24

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

func NewGoogleOSS added in v0.9.24

func NewGoogleOSS(configService config.IConfig, clockService clock.IClock, bucketsMapping map[string]*Bucket, env string) (*GoogleOSS, error)

func (*GoogleOSS) CreateObjectFromKey added in v0.9.27

func (ossStorage *GoogleOSS) CreateObjectFromKey(ormService *beeorm.Engine, bucket, key string) Object

func (*GoogleOSS) DeleteObject added in v0.9.24

func (ossStorage *GoogleOSS) DeleteObject(_ string, _ *Object) error

func (*GoogleOSS) GetClient added in v0.9.37

func (ossStorage *GoogleOSS) GetClient() interface{}

func (*GoogleOSS) GetObjectBase64Content added in v0.9.24

func (ossStorage *GoogleOSS) GetObjectBase64Content(bucket string, object *Object) (string, error)

func (*GoogleOSS) GetObjectCDNURL added in v0.9.24

func (ossStorage *GoogleOSS) GetObjectCDNURL(bucket string, object *Object) (string, error)

func (*GoogleOSS) GetObjectOSSURL added in v0.9.24

func (ossStorage *GoogleOSS) GetObjectOSSURL(bucket string, object *Object) (string, error)

func (*GoogleOSS) GetObjectSignedURL added in v0.9.24

func (ossStorage *GoogleOSS) GetObjectSignedURL(bucket string, object *Object, expires time.Time) (string, error)

func (*GoogleOSS) GetObjectURL added in v0.9.24

func (ossStorage *GoogleOSS) GetObjectURL(bucket string, object *Object) (string, error)

func (*GoogleOSS) GetUploaderBucketConfig added in v0.9.37

func (ossStorage *GoogleOSS) GetUploaderBucketConfig() *BucketConfig

func (*GoogleOSS) UploadImageFromBase64 added in v0.9.24

func (ossStorage *GoogleOSS) UploadImageFromBase64(ormService *beeorm.Engine, bucket, path, base64image, extension string) (Object, error)

func (*GoogleOSS) UploadImageFromFile added in v0.9.24

func (ossStorage *GoogleOSS) UploadImageFromFile(ormService *beeorm.Engine, bucket, path, localFile string) (Object, error)

func (*GoogleOSS) UploadObjectFromBase64 added in v0.9.24

func (ossStorage *GoogleOSS) UploadObjectFromBase64(ormService *beeorm.Engine, bucket, path, base64content, extension string) (Object, error)

func (*GoogleOSS) UploadObjectFromByte added in v0.9.24

func (ossStorage *GoogleOSS) UploadObjectFromByte(ormService *beeorm.Engine, bucket, path string, objectContent []byte, extension string) (Object, error)

func (*GoogleOSS) UploadObjectFromFile added in v0.9.24

func (ossStorage *GoogleOSS) UploadObjectFromFile(ormService *beeorm.Engine, bucket, path, localFile string) (Object, error)

type IProvider added in v0.9.26

type IProvider interface {
	GetClient() interface{}
	GetObjectURL(bucket string, object *Object) (string, error)
	GetObjectOSSURL(bucket string, object *Object) (string, error)
	GetObjectCDNURL(bucket string, object *Object) (string, error)
	GetObjectSignedURL(bucket string, object *Object, expires time.Time) (string, error)
	GetObjectBase64Content(bucket string, object *Object) (string, error)
	UploadObjectFromFile(ormService *beeorm.Engine, bucket, path, localFile string) (Object, error)
	UploadObjectFromBase64(ormService *beeorm.Engine, bucket, path, content, extension string) (Object, error)
	UploadObjectFromByte(ormService *beeorm.Engine, bucket, path string, content []byte, extension string) (Object, error)
	UploadImageFromFile(ormService *beeorm.Engine, bucket, path, localFile string) (Object, error)
	UploadImageFromBase64(ormService *beeorm.Engine, bucket, path, image, extension string) (Object, error)
	DeleteObject(bucket string, object *Object) error
	//TODO Remove
	CreateObjectFromKey(ormService *beeorm.Engine, bucket, key string) Object
	GetUploaderBucketConfig() *BucketConfig
}

type Object

type Object struct {
	ID         uint64
	StorageKey string
	Data       interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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