template

package
v0.0.0-...-4aaf4b1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

Index

Constants

This section is empty.

Variables

View Source
var (
	Request = &Template{}
)

Functions

func Config

func Config(str string)

Config 初始化配置参数信息到内存 @param str string

func NewClientV1

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

NewClientV1 存储到客户端管理

Types

type CfgConfig

type CfgConfig struct {
	Endpoint string `yaml:"endpoint" dc:"服务地址" tg:"rxx2c8o5q.hn-bkt.clouddn.com"`
}

func GetCfgConfig

func GetCfgConfig() *CfgConfig

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

type Template

type Template struct {
	CosType enums.CosType `dc:"代理仓库缓存类型"`

	Bucket string `yaml:"bucket"   dc:"对应的桶名称"`
	// contains filtered or unexported fields
}

func (*Template) GetLocation

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

GetLocation 组装并获取存储位置

func (*Template) GetObject

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

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

func (*Template) GetObjectExists

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

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

func (*Template) GetObjectList

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

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

func (*Template) GetObjectUri

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

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

func (*Template) GetObjectsInfo

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

GetObjectsInfo 组装数据存储对象

func (*Template) PutByObject

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

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

func (*Template) PutByObjectList

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

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

func (*Template) RemoveByObject

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

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

func (*Template) RemoveByObjectList

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

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

Jump to

Keyboard shortcuts

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