cos

package
v0.0.0-...-80b44f5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 23 Imported by: 0

README

Tencent COS —— Cloud Object Service Plugin

中文版

Added in version 0.4.0, inner name tccos.

Description

This plugin use Cloud Object Service (COS) of Tencent to store image files.

Options

You should provide 4 options: APPID, Secret ID, Secret Key and Bucket Name.

First three options should be provided in env var, use key RIKKA_TENCENT_APPID, RIKKA_TENCENT_SECRETID and RIKKA_TENCENT_SECRETKEY.

And the Bucket Name should be specified by the command line option -bname.

If you want, you can use option -bpath to set the path image will be store to(Notice: The path should already exist).

For example, -bpath rikka,will save image in rikka folder.

The object storage version is provided by the command line parameter -tccosVer. The default version is v4, for keep compatibility.

If you need to use v5 version, then have to set the region in the domain name by add the env var RIKKA_TENCENT_REGION.

Notices

As a "Static File Store Server", Tencent COS make browsers download the file when visits file url, instead of preview them.

In other word, if you visit a url of image saved in COS in your browser, it will download the image rather than open a new tab to preview the image.

But it's ok to use the image url in src attr of image element, or background attr of other elements in HTML,

If you want change this action, you need to bind COS to your own domain and enable the static website option.

Refer: Tencent COS static website option doc.

Guide

See Rikka Deploy Guide with TC-COS Plugin on DaoCloud.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArgCosVersion = flag.String("tccosVer", "v4", "Tencent cos sdk version, v4(default) or v5")

ArgCosVersion is flags for set Tencent cloud cos sdk version

View Source
var (

	// Plugin is the main plugin instance
	Plugin tencentCloudObjectStoragePlugin
)

Functions

func GetVersionWitchCheck

func GetVersionWitchCheck(l *logger.Logger) string

GetVersionWitchCheck get the version of Tencent cos version from arguments

Types

This section is empty.

Jump to

Keyboard shortcuts

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