tencent

package
v0.0.0-...-fc70b83 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package tencent @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package tencent @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package tencent @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package tencent @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package tencent @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package tencent @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package tencent @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientV1

func NewClientV1(types enums.CosType, proxy string) (client service.OssService)

NewClientV1 缓存到tencent Cos客户端管理

Types

type CfgConfig

type CfgConfig struct {
	Bucket    string `yaml:"bucket"   dc:"对应的桶名称"`
	Endpoint  string `yaml:"endpoint" dc:"服务地址" tg:"https://<bucket>.cos.<region>.myqcloud.com"`
	SecretId  string `yaml:"secretId" dc:"服务 ID" tg:"COS_SECRETID"`
	SecretKey string `yaml:"secretKey" dc:"服务 Key" tg:"COS_SECRETKEY"`
	Region    string `yaml:"region" dc:"存储地区区域" tg:"guangzhou"`
}

func GetCfgConfig

func GetCfgConfig() *CfgConfig

GetCfgConfig 获取配置的资源文件信息

type Tencent

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

func (*Tencent) BucketInfo

func (c *Tencent) BucketInfo() (*model.BucketInfo, error)

func (*Tencent) GetLocation

func (c *Tencent) GetLocation(moduleName string) string

GetLocation 组装并获取存储位置

func (*Tencent) GetObject

func (c *Tencent) GetObject(ctx context.Context, moduleName string) (m *model.ObjectsInfo, err error)

GetObject 获取返回文件流与error @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Tencent) GetObjectExists

func (c *Tencent) GetObjectExists(ctx context.Context, moduleName string) (bool, error)

GetObjectExists 获取文件是否存在 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Tencent) GetObjectList

func (c *Tencent) GetObjectList(ctx context.Context, moduleNames []string) (list []*model.ObjectsInfo, err error)

GetObjectList 获取对象存储服务下所有件夹列表 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Tencent) GetObjectUri

func (c *Tencent) GetObjectUri(ctx context.Context, moduleName string) (string, error)

GetObjectUri 获取文件的外链url @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Tencent) GetObjectsInfo

func (c *Tencent) GetObjectsInfo(moduleName string, data []byte) (m *model.ObjectsInfo)

GetObjectsInfo 组装数据存储对象

func (*Tencent) PutByObject

func (c *Tencent) PutByObject(ctx context.Context, moduleName string, reader []byte) (err error)

PutByObject 上传对象 @param moduleName 参数是 文件模块名称(请求的文件全路径名称) @param reader 参数是 文件字节数据

func (*Tencent) PutByObjectList

func (c *Tencent) PutByObjectList(ctx context.Context, maps map[string][]byte) (err error)

PutByObjectList 上传对象 @param maps key 参数是 文件模块名称(请求的文件全路径名称),value 参数是 文件字节数据

func (*Tencent) RemoveByObject

func (c *Tencent) RemoveByObject(ctx context.Context, moduleName string) error

RemoveByObject 删除对象 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Tencent) RemoveByObjectList

func (c *Tencent) RemoveByObjectList(ctx context.Context, moduleNames []string) error

RemoveByObjectList 删除对象集合 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Tencent) ViewMapDbFiles

func (c *Tencent) ViewMapDbFiles(ctx context.Context) (mp map[string][]byte)

Jump to

Keyboard shortcuts

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