interfaces

package
v0.0.0-...-997d260 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo interface {
	fs.FileInfo
	ContentType() string
}

type Gorm

type Gorm interface {
	// GetSources 获取主库的 gorm.Dialector 切片对象
	GetSources() (directories []gorm.Dialector)
	// GetReplicas 获取从库库的 gorm.Dialector 切片对象
	GetReplicas() (directories []gorm.Dialector)
	// GetResolver 通过主库与从库的链接组装 gorm.Plugin
	GetResolver() gorm.Plugin
	// GetGormDialector 获取数据库的 gorm.Dialector
	GetGormDialector(dsn string) gorm.Dialector
	// GetConfigPath 设置配置文件路径
	GetConfigPath() string
}

type GormConfig

type GormConfig interface {
	IsEmpty() bool
	GetDsn() string
}

type GormConfigGeneral

type GormConfigGeneral interface {
	GetMaxIdleConnes() int
	GetMaxOpenConnes() int
	GetConnMaxLifetime() time.Duration
	GetConnMaxIdleTime() time.Duration
}

type OSS

type OSS interface {
	// Delete 通过 key(唯一标识) 删除在oss上的文件
	Delete(key string) error
	// Upload 方便使用 os.File 数据上传oss
	Upload(reader io.Reader, info FileInfo) (filepath string, filename string, err error)
}

type Oss

type Oss interface {
	// DeleteByKey 通过 key(唯一标识) 删除在oss上的文件
	DeleteByKey(key string) error
	// UploadByFile 方便使用 os.File 数据上传oss
	UploadByFile(file multipart.File) (filepath string, filename string, err error)
	// UploadByFilepath 通过文件路径上传文件到oss
	UploadByFilepath(path string) (filepath string, filename string, err error)
	// UploadByFileHeader 方便从http框架接收到的 multipart.FileHeader 数据上传oss
	UploadByFileHeader(header *multipart.FileHeader) (filepath string, filename string, err error)
}
type Search interface {
	Search() func(db *gorm.DB) *gorm.DB
}

Jump to

Keyboard shortcuts

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