Documentation ¶
Overview ¶
Package leveldb @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package leveldb @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package leveldb @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package leveldb @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package leveldb @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package leveldb @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Index ¶
- Variables
- func Config(str string)
- func NewClientV1(types enums.CosType, proxy string) (client service.OssService)
- type CfgConfig
- type LevelDB
- func (c *LevelDB) GetLocation(moduleName string) string
- func (c *LevelDB) GetObject(ctx context.Context, moduleName string) (m *model.ObjectsInfo, err error)
- func (c *LevelDB) GetObjectExists(ctx context.Context, moduleName string) (bool, error)
- func (c *LevelDB) GetObjectList(ctx context.Context, moduleNames []string) (list []*model.ObjectsInfo, err error)
- func (c *LevelDB) GetObjectUri(ctx context.Context, moduleName string) (string, error)
- func (c *LevelDB) GetObjectsInfo(moduleName string, data []byte) (m *model.ObjectsInfo)
- func (c *LevelDB) PutByObject(ctx context.Context, moduleName string, reader []byte) (err error)
- func (c *LevelDB) PutByObjectList(ctx context.Context, maps map[string][]byte) (err error)
- func (c *LevelDB) RemoveByObject(ctx context.Context, moduleName string) error
- func (c *LevelDB) RemoveByObjectList(ctx context.Context, moduleNames []string) error
Constants ¶
This section is empty.
Variables ¶
var (
Request = &LevelDB{}
)
Functions ¶
func NewClientV1 ¶
func NewClientV1(types enums.CosType, proxy string) (client service.OssService)
NewClientV1 存储客户端管理 @param types 代理仓库对象存储服务类型(embedfs/leveldb等) @param proxy 缓存类型:如maven/golang/docker/npm/python等等 @return service.OssService接口构造,如 LevelDB
Types ¶
type CfgConfig ¶
type CfgConfig struct {
Storage string `yaml:"storage" default:"./storage" dc:"持久化LevelDB存储文件路径"`
}
type LevelDB ¶
type LevelDB struct {
// contains filtered or unexported fields
}
func (*LevelDB) GetLocation ¶
GetLocation 组装并获取存储位置 @param moduleName 参数是 文件模块名称(请求的文件全路径名称) @return 缓存位置(Storage) + 缓存类型(cosType) + 代理类型(proxy) + 代理文件相对路径(moduleName) storage/embedfs/alpine/v3.18/main/x86_64/acf-awall-0.4.1-r4.apk @Storage ./storage @cosType embedfs @proxy alpine @moduleName v3.18/main/x86_64/acf-awall-0.4.1-r4.apk
func (*LevelDB) GetObject ¶
func (c *LevelDB) GetObject(ctx context.Context, moduleName string) (m *model.ObjectsInfo, err error)
GetObject 获取返回文件流与error @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
func (*LevelDB) GetObjectExists ¶
GetObjectExists 获取文件是否存在 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
func (*LevelDB) GetObjectList ¶
func (c *LevelDB) GetObjectList(ctx context.Context, moduleNames []string) (list []*model.ObjectsInfo, err error)
GetObjectList 获取对象存储服务下所有件夹列表 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
func (*LevelDB) GetObjectUri ¶
GetObjectUri 获取文件的存储路径 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
func (*LevelDB) GetObjectsInfo ¶
func (c *LevelDB) GetObjectsInfo(moduleName string, data []byte) (m *model.ObjectsInfo)
GetObjectsInfo 组装数据存储对象
func (*LevelDB) PutByObject ¶
PutByObject 上传对象 @param moduleName 参数是 文件模块名称(请求的文件全路径名称) @param reader 参数是 文件字节数据
func (*LevelDB) PutByObjectList ¶
PutByObjectList 上传对象 @param maps key 参数是 文件模块名称(请求的文件全路径名称),value 参数是 文件字节数据
func (*LevelDB) RemoveByObject ¶
RemoveByObject 删除对象 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)