Documentation ¶
Index ¶
- Constants
- func Alive(ctx iris.Context)
- func EnableMessage(desc string, ...) error
- func GetIcon(ctx iris.Context)
- func ListenMsg(mh *MessageHandlerStruct)
- type Ability
- type AppFS
- func (afs *AppFS) Chtimes(path string, atime time.Time, mtime time.Time) error
- func (afs *AppFS) Destroy()
- func (afs *AppFS) EnsureDirExist(ps ...string)
- func (afs *AppFS) Exec(f func(*gorm.DB) error) error
- func (afs *AppFS) FileExists(path string) bool
- func (afs *AppFS) InodeToFileInfo(inode int64) *sdkdto.FileInfoRes
- func (afs *AppFS) InodeToPath(inode int64) string
- func (afs *AppFS) InodesToFileInfos(inodes ...int64) map[int64]*sdkdto.FileInfoRes
- func (afs *AppFS) MkdirAll(path string) error
- func (afs *AppFS) Open(path string) (*os.File, error)
- func (afs *AppFS) OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)
- func (afs *AppFS) PathToInode(path string) int64
- func (afs *AppFS) Remove(path string) error
- func (afs *AppFS) Rename(oldPath, newPath string) error
- type AppStruct
- func (a *AppStruct) NewAppFSFromCtx(ctx iris.Context) *AppFS
- func (a *AppStruct) NewAppFSFromUserGroupNamespace(ugn *utils.UserGroupNamespace) *AppFS
- func (a *AppStruct) NewFSFromCtx(ctx iris.Context) *FS
- func (a *AppStruct) NewFSFromUserGroupNamespace(ugn *utils.UserGroupNamespace) *FS
- func (a *AppStruct) UpdateModel(f func(gorm.Migrator))
- func (a *AppStruct) WithEventHolder()
- func (a *AppStruct) WithModel(models ...interface{})
- func (a *AppStruct) WithScheduleEvent()
- type ConsumeStatus
- type EventFS
- type EventHolder
- type FFmpeg
- type FS
- func (fs *FS) Chtimes(path string, atime time.Time, mtime time.Time) error
- func (fs *FS) Destroy()
- func (fs *FS) EnsureDirExist(ps ...string)
- func (fs *FS) Exec(f func(*gorm.DB) error) error
- func (fs *FS) FileExists(path string) bool
- func (fs *FS) InodeToFileInfo(inode int64) *sdkdto.FileInfoRes
- func (fs *FS) InodeToPath(inode int64) string
- func (fs *FS) InodesToFileInfos(inodes ...int64) map[int64]*sdkdto.FileInfoRes
- func (fs *FS) MkdirAll(path string) error
- func (fs *FS) NewFFmpeg() *FFmpeg
- func (fs *FS) NewKV() *KV
- func (fs *FS) NewSchedule() *Schedule
- func (fs *FS) Open(path string) (*os.File, error)
- func (fs *FS) OpenByInode(inode int64) (*os.File, error)
- func (fs *FS) OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)
- func (fs *FS) PathToInode(path string) int64
- func (fs *FS) Remove(path string) error
- func (fs *FS) Rename(oldPath, newPath string) error
- type FileEvent
- type KV
- type MediaType
- type Message
- type MessageEvent
- type MessageHandlerStruct
- type PreferOptions
- type Schedule
- func (s *Schedule) AddCronScheduleEvent(name string, payload []byte, c string) (err error, eventId *int64)
- func (s *Schedule) AddOnceScheduleEvent(name string, payload []byte, remindTime int64) (err error, eventId *int64)
- func (s *Schedule) UpdateCronScheduleEvent(eventId int64, c string) (err error)
- func (s *Schedule) UpdateOnceScheduleEvent(eventId int64, remindTime int64) (err error)
- type ScheduleEvent
- type ScheduleEventHandler
- type ScheduleHandler
- type SiyouFaasApi
- type TaskLevel
Constants ¶
const ( SiyouyunPrefix = "/.siyouyun" AppPrefix = SiyouyunPrefix + "/appdata" )
const ( AppCodeEnvKey = "APPCODE" IconPath = "/home/app/icon.png" )
const ( FileEventAdd = iota + 1 FileEventDelete )
文件事件类型,文件创建与文件删除
Variables ¶
This section is empty.
Functions ¶
func EnableMessage ¶ added in v0.2.20
func EnableMessage(desc string, handler func(appfs *AppFS, content string) (reply bool, replyContent string, replyToUUID bool)) error
EnableMessage 开启消息机器人 desc:
消息机器人的功能描述
handler func(content string) (reply bool, replyContent string, replyToUUID bool):
入参: - content 用户发送到机器人的消息正文 返回值: - reply : 是否需要回复 - replyContent : 回复的正文 - replyToUUID : 回复时是否引用用户消息
func ListenMsg ¶ added in v0.2.20
func ListenMsg(mh *MessageHandlerStruct)
Types ¶
type AppFS ¶ added in v0.1.22
type AppFS struct { *Ability // contains filtered or unexported fields }
func (*AppFS) EnsureDirExist ¶ added in v0.1.22
EnsureDirExist 确保目录存在
func (*AppFS) FileExists ¶ added in v0.1.22
FileExists 文件是否存在
func (*AppFS) InodeToFileInfo ¶ added in v0.1.22
InodeToFileInfo inode转fileInfo
func (*AppFS) InodeToPath ¶ added in v0.1.22
InodeToPath inode转path
func (*AppFS) InodesToFileInfos ¶ added in v0.1.22
InodesToFileInfos inodes转fileInfos
func (*AppFS) PathToInode ¶ added in v0.1.22
PathToInode path转inode
type AppStruct ¶ added in v0.1.23
type AppStruct struct { AppCode string Api SiyouFaasApi AppInfo *sdkdto.AppRegisterInfo Event *EventHolder Schedule *ScheduleHandler Model []interface{} DB *gorm.DB }
var App *AppStruct
func (*AppStruct) NewAppFSFromCtx ¶ added in v0.1.23
func (*AppStruct) NewAppFSFromUserGroupNamespace ¶ added in v0.4.9
func (a *AppStruct) NewAppFSFromUserGroupNamespace(ugn *utils.UserGroupNamespace) *AppFS
func (*AppStruct) NewFSFromCtx ¶ added in v0.1.23
func (*AppStruct) NewFSFromUserGroupNamespace ¶ added in v0.4.9
func (a *AppStruct) NewFSFromUserGroupNamespace(ugn *utils.UserGroupNamespace) *FS
func (*AppStruct) UpdateModel ¶ added in v0.4.2
UpdateModel 更新表(需要删除更改字段或索引时使用)
func (*AppStruct) WithEventHolder ¶ added in v0.1.23
func (a *AppStruct) WithEventHolder()
WithEventHolder 初始化事件监听器
func (*AppStruct) WithModel ¶ added in v0.1.24
func (a *AppStruct) WithModel(models ...interface{})
WithModel 自动迁移表
func (*AppStruct) WithScheduleEvent ¶ added in v0.2.29
func (a *AppStruct) WithScheduleEvent()
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 FFmpeg ¶ added in v0.2.3
type FFmpeg struct {
*gateway.FFmpegOSApi
}
func (*FFmpeg) GetBasicInfo ¶ added in v0.2.3
func (*FFmpeg) GetDetailInfo ¶ added in v0.2.3
type FS ¶ added in v0.1.7
type FS struct { AppCodeName string *Ability App *AppStruct UGN *utils.UserGroupNamespace // contains filtered or unexported fields }
FS fs
func (*FS) EnsureDirExist ¶ added in v0.1.16
EnsureDirExist 确保目录存在
func (*FS) FileExists ¶ added in v0.1.16
FileExists 文件是否存在
func (*FS) InodeToFileInfo ¶ added in v0.1.16
InodeToFileInfo inode转fileInfo
func (*FS) InodeToPath ¶ added in v0.1.16
InodeToPath inode转path
func (*FS) InodesToFileInfos ¶ added in v0.1.16
InodesToFileInfos inodes转fileInfos
func (*FS) NewSchedule ¶ added in v0.2.29
func (*FS) OpenByInode ¶ added in v0.4.0
OpenByInode 根据inode打开文件
func (*FS) PathToInode ¶ added in v0.1.16
PathToInode path转inode
type FileEvent ¶ added in v0.1.7
type FileEvent struct { Inode int64 `json:"inode"` FullPath string `json:"fullPath"` Action int `json:"action"` UGN utils.UserGroupNamespace `json:"ugn"` }
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 MessageEvent ¶ added in v0.2.20
type MessageEvent struct { UGN utils.UserGroupNamespace `json:"ugn"` UUID string `json:"uuid"` Content string `json:"content"` SessionId string `json:"sessionId"` SendByAdmin bool `json:"sendByAdmin"` }
MessageEvent 消息在事件中传递的结构
type MessageHandlerStruct ¶ added in v0.2.20
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(fs *EventFS) (ConsumeStatus, string) `json:"-"` // 处理器 }
PreferOptions 事件偏好选项
type Schedule ¶ added in v0.2.29
type Schedule struct {
*gateway.ScheduleApi
}
func (*Schedule) AddCronScheduleEvent ¶ added in v0.2.29
func (*Schedule) AddOnceScheduleEvent ¶ added in v0.2.29
func (*Schedule) UpdateCronScheduleEvent ¶ added in v0.2.32
type ScheduleEvent ¶ added in v0.2.29
type ScheduleEvent struct { UGN utils.UserGroupNamespace `json:"ugn"` RemindTime int64 `json:"remindTime"` Name string `json:"name"` Payload []byte `json:"payload"` }
type ScheduleEventHandler ¶ added in v0.2.29
type ScheduleEventHandler struct { Name string Handler func(fs *EventFS, se *ScheduleEvent) }
type ScheduleHandler ¶ added in v0.2.29
type ScheduleHandler struct {
// contains filtered or unexported fields
}
func (*ScheduleHandler) Listen ¶ added in v0.2.29
func (sh *ScheduleHandler) Listen()
func (*ScheduleHandler) SetHandler ¶ added in v0.2.29
func (sh *ScheduleHandler) SetHandler(shs ...ScheduleEventHandler)
type SiyouFaasApi ¶
type SiyouFaasApi map[string]func(iris.Context)
func (SiyouFaasApi) Delete ¶
func (api SiyouFaasApi) Delete(uri string, f func(iris.Context))
func (SiyouFaasApi) Get ¶
func (api SiyouFaasApi) Get(uri string, f func(iris.Context))
func (SiyouFaasApi) Post ¶
func (api SiyouFaasApi) Post(uri string, f func(iris.Context))
func (SiyouFaasApi) Put ¶
func (api SiyouFaasApi) Put(uri string, f func(iris.Context))