leveldb

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: 11 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var (
	Request = &LevelDB{}
)

Functions

func Config

func Config(str string)

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

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存储文件路径"`
}

func GetCfgConfig

func GetCfgConfig() *CfgConfig

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

type LevelDB

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

func (*LevelDB) GetLocation

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

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

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

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

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

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

func (*LevelDB) GetObjectsInfo

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

GetObjectsInfo 组装数据存储对象

func (*LevelDB) PutByObject

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

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

func (*LevelDB) PutByObjectList

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

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

func (*LevelDB) RemoveByObject

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

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

func (*LevelDB) RemoveByObjectList

func (c *LevelDB) 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