Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrivateInit ¶
func PrivateInit(group *ghttp.RouterGroup, plugins ...Plugin)
PrivateInit 私有路由组注册初始化
Types ¶
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 GormConfigGeneral ¶
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 Plugin ¶
type Plugin interface { // RouterPath 用户返回注册路由 RouterPath() string // PublicRouterGroup 公开路由组 PublicRouterGroup(group *ghttp.RouterGroup) PublicRouter // PrivateRouterGroup 私有路由组注册 PrivateRouterGroup(group *ghttp.RouterGroup) PrivateRouter }
Plugin 插件模式接口化
type PrivateRouter ¶
type PrivateRouter interface { // Private 私有路由组 Private() PrivateRouter // PrivateWithoutRecord 私有路由组 不需要记录日志 PrivateWithoutRecord() PrivateRouter }
type PublicRouter ¶
type PublicRouter interface { // Public 公有路由组 Public() PublicRouter // PublicWithoutRecord 公有路由组 不需要记录日志 PublicWithoutRecord() PublicRouter }
Click to show internal directories.
Click to hide internal directories.