service

package
v0.0.0-...-f55c371 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package service @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

This section is empty.

Types

type OssService

type OssService interface {

	// BucketInfo 获取组件配置的Bucket快信息
	BucketInfo(ctx context.Context) (*model.BucketInfo, error)

	// GetLocation 组装并获取存储位置
	// @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
	GetLocation(moduleName string) string

	// GetData 组装数据存储对象
	GetData(moduleName string, data []byte) (m *model.ObjectsInfo)

	// GetObject  获取返回文件流与error
	// @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
	GetObject(ctx context.Context, moduleName string) (m *model.ObjectsInfo, err error)

	// GetObjectList 获取对象存储服务下所有件夹列表
	// @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
	GetObjectList(ctx context.Context, moduleNames []string) (list []*model.ObjectsInfo, err error)

	// GetObjectUrl 获取文件的外链url
	// @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
	GetObjectUrl(ctx context.Context, moduleName string) (string, error)

	// GetObjectExists 获取文件是否存在
	// @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
	GetObjectExists(ctx context.Context, moduleName string) (bool, error)

	// PutByObject 上传对象
	// @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
	// @param reader 参数是 文件字节数据
	PutByObject(ctx context.Context, moduleName string, reader []byte) (err error)

	// PutByObjectList 上传对象
	// @param maps key 参数是 文件模块名称(请求的文件全路径名称),value 参数是 文件字节数据
	PutByObjectList(ctx context.Context, maps map[string][]byte) (err error)

	// RemoveByObject 删除对象
	// @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
	RemoveByObject(ctx context.Context, moduleName string) error

	// RemoveByObjectList 删除对象集合
	// @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
	RemoveByObjectList(ctx context.Context, moduleNames []string) error
}

OssService 对象存储服务借口

Jump to

Keyboard shortcuts

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