oss

package
v1.2.55 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 (*AmazonOSS) CreateObjectFromKey added in v0.9.24

func (ossStorage *AmazonOSS) CreateObjectFromKey(ormService *beeorm.Engine, bucket Bucket, key string) entity.FileObject

func (*AmazonOSS) DeleteObject added in v0.9.24

func (ossStorage *AmazonOSS) DeleteObject(bucket Bucket, object *entity.FileObject) error

func (*AmazonOSS) GetBucketConfig added in v1.0.50

func (ossStorage *AmazonOSS) GetBucketConfig(bucket Bucket) *BucketConfig

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(_ Bucket, _ *entity.FileObject) (string, error)

func (*AmazonOSS) GetObjectCDNURL added in v0.9.24

func (ossStorage *AmazonOSS) GetObjectCDNURL(bucket Bucket, object *entity.FileObject) (string, error)

func (*AmazonOSS) GetObjectOSSURL added in v0.9.24

func (ossStorage *AmazonOSS) GetObjectOSSURL(_ Bucket, _ *entity.FileObject) (string, error)

func (*AmazonOSS) GetObjectSignedURL added in v0.9.24

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

func (*AmazonOSS) GetObjectURL added in v0.9.24

func (ossStorage *AmazonOSS) GetObjectURL(bucket Bucket, object *entity.FileObject) (string, error)

func (*AmazonOSS) UploadImageFromBase64 added in v0.9.24

func (ossStorage *AmazonOSS) UploadImageFromBase64(
	ormService *beeorm.Engine,
	bucket Bucket,
	namespace Namespace,
	image string,
	extension string,
) (entity.FileObject, error)

func (*AmazonOSS) UploadImageFromFile added in v0.9.24

func (ossStorage *AmazonOSS) UploadImageFromFile(
	ormService *beeorm.Engine, bucket Bucket, namespace Namespace, localFile string) (entity.FileObject, error)

func (*AmazonOSS) UploadObjectFromBase64 added in v0.9.24

func (ossStorage *AmazonOSS) UploadObjectFromBase64(
	ormService *beeorm.Engine,
	bucket Bucket,
	namespace Namespace,
	content string,
	extension string,
) (entity.FileObject, error)

func (*AmazonOSS) UploadObjectFromByte added in v0.9.24

func (ossStorage *AmazonOSS) UploadObjectFromByte(
	ormService *beeorm.Engine,
	bucket Bucket,
	namespace Namespace,
	objectContent []byte,
	extension string,
) (entity.FileObject, error)

func (*AmazonOSS) UploadObjectFromFile added in v0.9.24

func (ossStorage *AmazonOSS) UploadObjectFromFile(
	ormService *beeorm.Engine, bucket Bucket, namespace Namespace, localFile string) (entity.FileObject, error)

type Bucket added in v0.9.72

type Bucket string
const (
	BucketPrivate Bucket = "private"
	BucketPublic  Bucket = "public"
)

func (Bucket) String added in v1.0.50

func (b Bucket) String() string

type BucketConfig added in v0.9.24

type BucketConfig struct {
	StorageCounterDatabaseID uint64
	Type                     Bucket
	Name                     string
	CDNURL                   string
	Namespaces               map[Namespace]Namespace
	ACL                      string
}

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 (*GoogleOSS) CreateObjectFromKey added in v0.9.27

func (ossStorage *GoogleOSS) CreateObjectFromKey(ormService *beeorm.Engine, bucket Bucket, key string) entity.FileObject

func (*GoogleOSS) DeleteObject added in v0.9.24

func (ossStorage *GoogleOSS) DeleteObject(_ Bucket, _ *entity.FileObject) error

func (*GoogleOSS) GetBucketConfig added in v1.0.50

func (ossStorage *GoogleOSS) GetBucketConfig(bucket Bucket) *BucketConfig

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 Bucket, object *entity.FileObject) (string, error)

func (*GoogleOSS) GetObjectCDNURL added in v0.9.24

func (ossStorage *GoogleOSS) GetObjectCDNURL(bucket Bucket, object *entity.FileObject) (string, error)

func (*GoogleOSS) GetObjectOSSURL added in v0.9.24

func (ossStorage *GoogleOSS) GetObjectOSSURL(bucket Bucket, object *entity.FileObject) (string, error)

func (*GoogleOSS) GetObjectSignedURL added in v0.9.24

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

func (*GoogleOSS) GetObjectURL added in v0.9.24

func (ossStorage *GoogleOSS) GetObjectURL(bucket Bucket, object *entity.FileObject) (string, error)

func (*GoogleOSS) UploadImageFromBase64 added in v0.9.24

func (ossStorage *GoogleOSS) UploadImageFromBase64(
	ormService *beeorm.Engine,
	bucket Bucket,
	namespace Namespace,
	base64image string,
	extension string,
) (entity.FileObject, error)

func (*GoogleOSS) UploadImageFromFile added in v0.9.24

func (ossStorage *GoogleOSS) UploadImageFromFile(
	ormService *beeorm.Engine, bucket Bucket, namespace Namespace, localFile string) (entity.FileObject, error)

func (*GoogleOSS) UploadObjectFromBase64 added in v0.9.24

func (ossStorage *GoogleOSS) UploadObjectFromBase64(
	ormService *beeorm.Engine,
	bucket Bucket,
	namespace Namespace,
	base64content,
	extension string,
) (entity.FileObject, error)

func (*GoogleOSS) UploadObjectFromByte added in v0.9.24

func (ossStorage *GoogleOSS) UploadObjectFromByte(
	ormService *beeorm.Engine,
	bucket Bucket,
	namespace Namespace,
	objectContent []byte,
	extension string,
) (entity.FileObject, error)

func (*GoogleOSS) UploadObjectFromFile added in v0.9.24

func (ossStorage *GoogleOSS) UploadObjectFromFile(
	ormService *beeorm.Engine, bucket Bucket, namespace Namespace, localFile string) (entity.FileObject, error)

type IProvider added in v0.9.26

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

func NewAmazonOSS added in v0.9.24

func NewAmazonOSS(configService config.IConfig, clockService clock.IClock, publicNamespaces, privateNamespaces []Namespace) (IProvider, error)

func NewGoogleOSS added in v0.9.24

func NewGoogleOSS(configService config.IConfig, clockService clock.IClock, publicNamespaces, privateNamespaces []Namespace) (IProvider, error)

type Namespace added in v1.0.50

type Namespace string

func (Namespace) String added in v1.0.50

func (n Namespace) String() string

type NewProviderFunc added in v1.0.50

type NewProviderFunc func(configService config.IConfig, clockService clock.IClock, publicNamespaces, privateNamespaces []Namespace) (IProvider, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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