tencentyuncos

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Tencent COS Storage

This plugin can be used to store attachments and avatars to Tencent COS.

How to use

Build
./answer build --with github.com/apache/answer-plugins/storage-tencentyuncos
Configuration
  • Region - Region of Tencent COS storage, like 'ap-beijing'
  • Bucket Name - Your bucket name
  • Object Key Prefix - Prefix of the object key like 'answer/data/' that ending with '/'
  • Secret ID - Secret ID of the Tencent COS storage
  • Secret Key - Secret Key of the Tencent COS 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) CheckFileType

func (s *Storage) CheckFileType(originalFilename string, source plugin.UploadSource) bool

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.0.3

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.0.3

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 {
	Region          string `json:"region"`
	BucketName      string `json:"bucket_name"`
	ObjectKeyPrefix string `json:"object_key_prefix"`
	SecretID        string `json:"secret_id"`
	SecretKey       string `json:"secret_key"`
	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