aliyunoss

package module
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

README

Aliyun OSS Storage

This plugin can be used to store attachments and avatars to Aliyun OSS.

How to use

Build
./answer build --with github.com/apache/answer-plugins/storage-aliyunoss
Configuration
  • Endpoint - Endpoint of AliCloud OSS storage, such as oss-cn-hangzhou.aliyuncs.com
  • Bucket Name - Your bucket name
  • Object Key Prefix - Prefix of the object key like 'answer/data/' that ending with '/'
  • Access Key Id - AccessKeyID of the AliCloud OSS storage
  • Access Key Secret - AccessKeySecret of the AliCloud OSS storage
  • Visit Url Prefix - Prefix of access address for the uploaded file, ending with '/' such as https://example.com/xxx/

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Info embed.FS

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Config *StorageConfig
}

func (*Storage) ConfigFields

func (s *Storage) ConfigFields() []plugin.ConfigField

func (*Storage) ConfigReceiver

func (s *Storage) ConfigReceiver(config []byte) error

func (*Storage) ExceedFileSizeLimit added in v1.2.11

func (s *Storage) ExceedFileSizeLimit(fileSize int64, condition plugin.UploadFileCondition) bool

func (*Storage) Info

func (s *Storage) Info() plugin.Info

func (*Storage) IsUnsupportedFileType added in v1.2.11

func (s *Storage) IsUnsupportedFileType(originalFilename string, condition plugin.UploadFileCondition) bool

func (*Storage) UploadFile

func (s *Storage) UploadFile(ctx *plugin.GinContext, condition plugin.UploadFileCondition) (resp plugin.UploadFileResponse)

type StorageConfig

type StorageConfig struct {
	Endpoint        string `json:"endpoint"`
	BucketName      string `json:"bucket_name"`
	ObjectKeyPrefix string `json:"object_key_prefix"`
	AccessKeyID     string `json:"access_key_id"`
	AccessKeySecret string `json:"access_key_secret"`
	VisitUrlPrefix  string `json:"visit_url_prefix"`
	ACL             string `json:"acl"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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