Documentation ¶
Index ¶
- Constants
- func Alive(ctx iris.Context)
- func GetIcon(ctx iris.Context)
- type Ability
- func (a *Ability) AI() (*ability.AI, error)
- func (a *Ability) Destroy()
- func (a *Ability) FFmpeg() (*ability.FFmpeg, error)
- func (a *Ability) FS() *ability.FS
- func (a *Ability) KV() (*ability.KV, error)
- func (a *Ability) Message() (*ability.Message, error)
- func (a *Ability) Schedule() (*ability.Schedule, error)
- type AbilityInterface
- type AppBuilder
- type AppStruct
- func (a *AppStruct) Destroy()
- func (a *AppStruct) WithAI()
- func (a *AppStruct) WithDataMigrator(migrateData func(db *gorm.DB) error, ...)
- func (a *AppStruct) WithEventHolder()
- func (a *AppStruct) WithFFmpeg()
- func (a *AppStruct) WithFS()
- func (a *AppStruct) WithKV()
- func (a *AppStruct) WithMessage()
- func (a *AppStruct) WithSchedule()
- func (a *AppStruct) WithSchemaMigrator(migrateSchema func(db *gorm.DB) error, ...)
- type ConsumeStatus
- type EventHolder
- type FileEvent
- type MediaType
- type PreferOptions
- type SiyouFaaSApi
- type TaskLevel
Constants ¶
const ( AppCodeEnvKey = "APPCODE" IconPath = "/home/app/icon.png" )
const ( FileEventAdd = iota + 1 // 文件创建 FileEventDelete // 文件删除 FileEventRename // 文件重命名 )
文件事件类型
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ability ¶ added in v0.2.3
type Ability struct {
// contains filtered or unexported fields
}
Ability app ability set
type AbilityInterface ¶ added in v0.5.4
type AbilityInterface interface { // Name of ability Name() string // Close resources Close() }
AbilityInterface ability interface
type AppBuilder ¶ added in v0.4.16
type AppBuilder struct {
// contains filtered or unexported fields
}
AppBuilder app builder
func NewAppBuilder ¶ added in v0.4.16
func NewAppBuilder(appCode string) *AppBuilder
NewAppBuilder new a custom app builder
func (*AppBuilder) Build ¶ added in v0.4.16
func (b *AppBuilder) Build()
func (*AppBuilder) WithApi ¶ added in v0.4.16
func (b *AppBuilder) WithApi(api SiyouFaaSApi) *AppBuilder
func (*AppBuilder) WithDB ¶ added in v0.4.16
func (b *AppBuilder) WithDB(db *gorm.DB) *AppBuilder
func (*AppBuilder) WithNC ¶ added in v0.4.18
func (b *AppBuilder) WithNC(nc *nats.Conn) *AppBuilder
type AppStruct ¶ added in v0.1.23
type AppStruct struct { AppCode string Event *EventHolder Ability *Ability // app ability Api SiyouFaaSApi // app interfaces // contains filtered or unexported fields }
var App *AppStruct
func (*AppStruct) WithDataMigrator ¶ added in v0.9.5
func (a *AppStruct) WithDataMigrator(migrateData func(db *gorm.DB) error, afterFunc func(*utils.UserGroupNamespace) error)
WithDataMigrator Migrate db data The data is migrated when the user is registered After the migrateData processing of each UGN is completed, afterFunc is executed (After the transaction is committed)
func (*AppStruct) WithEventHolder ¶ added in v0.1.23
func (a *AppStruct) WithEventHolder()
WithEventHolder 初始化事件监听器
func (*AppStruct) WithFFmpeg ¶ added in v0.5.4
func (a *AppStruct) WithFFmpeg()
WithFFmpeg add ffmpeg support
func (*AppStruct) WithMessage ¶ added in v0.5.4
func (a *AppStruct) WithMessage()
WithMessage add message support
func (*AppStruct) WithSchedule ¶ added in v0.7.0
func (a *AppStruct) WithSchedule()
WithSchedule add schedule support
func (*AppStruct) WithSchemaMigrator ¶ added in v0.9.5
func (a *AppStruct) WithSchemaMigrator(migrateSchema func(db *gorm.DB) error, afterFunc func(*utils.UserGroupNamespace) error)
WithSchemaMigrator Migrate db schema The schema is migrated when the application is started After the migrateSchema processing of each UGN is completed, afterFunc is executed (After the transaction is committed)
type ConsumeStatus ¶ added in v0.2.7
type ConsumeStatus int
const ( ConsumeSuccess ConsumeStatus = iota + 1 ConsumeRetry ConsumeFail )
type EventHolder ¶ added in v0.1.7
type EventHolder struct {
// contains filtered or unexported fields
}
func (*EventHolder) SetPrefer ¶ added in v0.1.7
func (e *EventHolder) SetPrefer(options ...PreferOptions)
SetPrefer 设置偏好与回调函数
type MediaType ¶ added in v0.4.5
type MediaType string
MediaType 文件媒体类型
const ( MediaTypeText MediaType = "text" MediaTypeImage MediaType = "image" MediaTypeAudio MediaType = "audio" MediaTypeVideo MediaType = "video" MediaTypeMessage MediaType = "message" )
偏好设置可以关注的文件媒体类型,上半部分为标准媒体类型,下半部分为自定义媒体类型 标准媒体类型
const ( MediaTypeAll MediaType = "all" // 全部类型 MediaTypeCompress MediaType = "compress" // 压缩包类型 MediaTypeImageVideo MediaType = "image-video" // 图片+视频类型 MediaTypeDoc MediaType = "doc" // 文档类型 MediaTypeBt MediaType = "bt" // 种子类型 MediaTypeEbook MediaType = "ebook" // 电子书类型 MediaTypeSoftware MediaType = "software" // 软件包类型 MediaTypeOther MediaType = "other" // 其他类型 )
自定义媒体类型
type PreferOptions ¶ added in v0.1.7
type PreferOptions struct { MediaType MediaType `json:"mediaType"` // 媒体类型 FileEventType int `json:"fileEventType"` // 事件类型 FollowDirs []string `json:"followDirs"` // 关注目录(不设置默认所有) ExcludeExts []string `json:"excludeExts"` // 排除的文件后缀 Description string `json:"description"` // 描述 Priority TaskLevel `json:"priority"` // 优先级(资源占用等级) Handler func(fe *FileEvent) (ConsumeStatus, string) `json:"-"` // 处理器 }
PreferOptions 事件偏好选项
type SiyouFaaSApi ¶ added in v0.4.15
type SiyouFaaSApi map[string]func(iris.Context)
func (SiyouFaaSApi) Delete ¶ added in v0.4.15
func (api SiyouFaaSApi) Delete(uri string, f func(iris.Context))
func (SiyouFaaSApi) Get ¶ added in v0.4.15
func (api SiyouFaaSApi) Get(uri string, f func(iris.Context))
func (SiyouFaaSApi) Post ¶ added in v0.4.15
func (api SiyouFaaSApi) Post(uri string, f func(iris.Context))
func (SiyouFaaSApi) Put ¶ added in v0.4.15
func (api SiyouFaaSApi) Put(uri string, f func(iris.Context))