Documentation ¶
Overview ¶
Package embedfs @Link https://gitee.com/linngc/central.mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License
Package embedfs @Link https://gitee.com/linngc/central.mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License
Package embedfs @Link https://gitee.com/linngc/central.mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License
Package embedfs @Link https://gitee.com/linngc/central.mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License
Package embedfs @Link https://gitee.com/linngc/central.mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License
Index ¶
- Variables
- func NewClientV1(types enums.CosType, proxy string) (client service.OssService)
- func OnConfig(str string)
- type EmbedFs
- func (c *EmbedFs) BucketInfo(ctx context.Context) (*model.BucketInfo, error)
- func (c *EmbedFs) GetData(moduleName string, data []byte) (m *model.ObjectsInfo)
- func (c *EmbedFs) GetLocation(moduleName string) string
- func (c *EmbedFs) GetObject(ctx context.Context, moduleName string) (m *model.ObjectsInfo, err error)
- func (c *EmbedFs) GetObjectExists(ctx context.Context, moduleName string) (bool, error)
- func (c *EmbedFs) GetObjectList(ctx context.Context, moduleNames []string) (list []*model.ObjectsInfo, err error)
- func (c *EmbedFs) GetObjectUrl(ctx context.Context, moduleName string) (string, error)
- func (c *EmbedFs) PutByObject(ctx context.Context, moduleName string, reader []byte) (err error)
- func (c *EmbedFs) PutByObjectList(ctx context.Context, maps map[string][]byte) (err error)
- func (c *EmbedFs) RemoveByObject(ctx context.Context, moduleName string) error
- func (c *EmbedFs) RemoveByObjectList(ctx context.Context, moduleNames []string) error
Constants ¶
This section is empty.
Variables ¶
var ( Request = &EmbedFs{} FileSystem http.FileSystem )
Functions ¶
func NewClientV1 ¶
func NewClientV1(types enums.CosType, proxy string) (client service.OssService)
NewClientV1 存储到本地文件夹客户端管理
Types ¶
type EmbedFs ¶
type EmbedFs struct { CosType enums.CosType `dc:"代理仓库缓存类型"` Storage string `yaml:"storage" default:"./storage/embedfs" dc:"本地存储文件路径"` Bucket string `yaml:"bucket" default:"" dc:"对应的桶名称"` // contains filtered or unexported fields }
func (*EmbedFs) BucketInfo ¶
BucketInfo 获取文件块信息
func (*EmbedFs) GetData ¶
func (c *EmbedFs) GetData(moduleName string, data []byte) (m *model.ObjectsInfo)
GetData 组装数据存储对象
func (*EmbedFs) GetLocation ¶
GetLocation 组装并获取存储位置 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
func (*EmbedFs) GetObject ¶
func (c *EmbedFs) GetObject(ctx context.Context, moduleName string) (m *model.ObjectsInfo, err error)
GetObject 获取返回文件流与error @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
func (*EmbedFs) GetObjectExists ¶
GetObjectExists 获取文件是否存在 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
func (*EmbedFs) GetObjectList ¶
func (c *EmbedFs) GetObjectList(ctx context.Context, moduleNames []string) (list []*model.ObjectsInfo, err error)
GetObjectList 获取对象存储服务下所有件夹列表 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
func (*EmbedFs) GetObjectUrl ¶
GetObjectUrl 获取文件的外链url @param moduleName 参数是 文件模块名称(请求的文件全路径名称)
func (*EmbedFs) PutByObject ¶
PutByObject 上传对象 @param moduleName 参数是 文件模块名称(请求的文件全路径名称) @param reader 参数是 文件字节数据
func (*EmbedFs) PutByObjectList ¶
PutByObjectList 上传对象 @param maps key 参数是 文件模块名称(请求的文件全路径名称),value 参数是 文件字节数据
func (*EmbedFs) RemoveByObject ¶
RemoveByObject 删除对象 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)