Documentation ¶
Overview ¶
Package common @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package common @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package common @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package common @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package common @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Package common @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2024 central-mirror CLI @Author linngc @License
Index ¶
- func OnCacheCfg(str string)
- type CacheConfig
- type Common
- func (c *Common) AddBatchSync(mirror string, localPaths []string) (err error)
- func (c *Common) AddChannelMapping(readAll []byte, localPath string) (err error)
- func (c *Common) AddMapping(readAll []byte, localPath string) (err error)
- func (c *Common) DelMapping(localPath string) (err error)
- func (c *Common) GetInternetMapping(mirrorPath, localPath string) (u *cacheModel.ObjectsInfo, err error)
- func (c *Common) GetMapping(localPath string) (u *cacheModel.ObjectsInfo, err error)
- func (c *Common) GetOrAddMapping(mirrorPath, localPath string) (u *cacheModel.ObjectsInfo, err error)
- func (c *Common) Pings() (p map[string]int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheConfig ¶
type Common ¶
type Common struct {
// contains filtered or unexported fields
}
Common 通用方法提取
func GetCommon ¶
func GetCommon(ctx context.Context, cosType, proxy, mirror string) (dial *clientV1.ClientV1, com *Common)
GetCommon 仓库连接 @param ctx 上下文 @param cosType 代理仓库对象存储服务类型 @param proxy 缓存类型:如maven/golang/docker/npm/python等等 @param mirror 中央仓库代理地址
func GetGlobalCache ¶
GetGlobalCache 创建配置,并实例化缓存服务 @param ctx 上下文 @param proxy 缓存相对地址(缓存类型:如maven/golang/docker/npm/python等等)
func (*Common) AddBatchSync ¶
AddBatchSync 异步批量存储 @param mirror 中央仓库代理地址 @param localPath 文件存储路径
func (*Common) AddChannelMapping ¶
AddChannelMapping 将文件存储到本地缓存中 @param localPath 文件存储路径 @param data 文件对象
func (*Common) AddMapping ¶
AddMapping 将文件存储到本地缓存中 @param proxy 缓存类型(alpine/golang/maven/python) @param localPath 文件存储路径 @param data 文件对象
func (*Common) DelMapping ¶
DelMapping 删除本地缓存中的文件 @param localPath 文件存储路径
func (*Common) GetInternetMapping ¶
func (c *Common) GetInternetMapping(mirrorPath, localPath string) (u *cacheModel.ObjectsInfo, err error)
GetInternetMapping 从网络上在线获取文件 @param proxy 缓存类型(alpine/golang/maven/python) @param mirror 中央仓库代理地址 @param localPath 文件存储路径
func (*Common) GetMapping ¶
func (c *Common) GetMapping(localPath string) (u *cacheModel.ObjectsInfo, err error)
GetMapping 获取本地缓存中的文件 @param localPath 文件存储路径
func (*Common) GetOrAddMapping ¶
func (c *Common) GetOrAddMapping(mirrorPath, localPath string) (u *cacheModel.ObjectsInfo, err error)
GetOrAddMapping 获取并保存 @param mirrorPath 中央仓库请求路径 @param localPath 文件存储路径