factory

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

func New

func New(conf *config.Config) *Factory

func (*Factory) CheckSize

func (f *Factory) CheckSize(size int64) error

CheckSize 检查大小是否合法

func (*Factory) CheckType

func (f *Factory) CheckType(tp string) error

CheckType 检查文件类型是否合法

func (*Factory) ChunkCount

func (f *Factory) ChunkCount(size int64) int

ChunkCount 通过文件大小获取分片数量

func (*Factory) FileMime

func (f *Factory) FileMime(body []byte) string

FileMime 获取文件的Mime

func (*Factory) FileSrc

func (f *Factory) FileSrc(src string) string

func (*Factory) FileSrcFormat

func (f *Factory) FileSrcFormat() string

func (*Factory) GetType

func (f *Factory) GetType(name string) string

GetType 获取文件类型

func (*Factory) MaxChunkSize

func (f *Factory) MaxChunkSize() int64

MaxChunkSize 获取分片的大小 单位KB

func (*Factory) MaxSingularSize

func (f *Factory) MaxSingularSize() int64

MaxSingularSize 获取单个文件的最大大小,单位KB

func (*Factory) Storage

func (f *Factory) Storage() string

func (*Factory) Store

func (f *Factory) Store(ctx kratosx.Context) (store2.Store, error)

func (*Factory) StoreKey

func (f *Factory) StoreKey(sha, tp string) string

StoreKey 获取存储的key

Jump to

Keyboard shortcuts

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