ability

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SiyouyunPrefix = "/.siyouyun"
	AppPrefix      = SiyouyunPrefix + "/appdata"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AI

type AI struct {
	sdkprotos.AIServiceClient
	// contains filtered or unexported fields
}

func NewAI

func NewAI() *AI

func (*AI) Close

func (a *AI) Close()

func (*AI) Name

func (a *AI) Name() string

type FFmpeg

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

func NewFFmpeg

func NewFFmpeg() *FFmpeg

func (*FFmpeg) Close

func (ff *FFmpeg) Close()

func (*FFmpeg) GetBasicInfo

func (ff *FFmpeg) GetBasicInfo(ugn *utils.UserGroupNamespace, parentPath, name string) (*sdkdto.FFmpegBasicInfo, error)

func (*FFmpeg) GetDetailInfo

func (ff *FFmpeg) GetDetailInfo(ugn *utils.UserGroupNamespace, parentPath, name string) (*sdkdto.FFProbeInfo, error)

func (*FFmpeg) Name

func (ff *FFmpeg) Name() string

type FS

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

func NewFS

func NewFS(appCode *string, db *gorm.DB) *FS

func (*FS) Close

func (f *FS) Close()

func (*FS) Name

func (f *FS) Name() string

func (*FS) NewAppFSFromCtx

func (f *FS) NewAppFSFromCtx(ctx iris.Context) GenericFS

func (*FS) NewAppFSFromUserGroupNamespace

func (f *FS) NewAppFSFromUserGroupNamespace(ugn *utils.UserGroupNamespace) GenericFS

func (*FS) NewFSFromCtx

func (f *FS) NewFSFromCtx(ctx iris.Context) GenericFS

func (*FS) NewFSFromUserGroupNamespace

func (f *FS) NewFSFromUserGroupNamespace(ugn *utils.UserGroupNamespace) GenericFS

type GenericFS

type GenericFS interface {
	Open(path string) (*os.File, error)
	OpenByInode(inode uint64) (*os.File, error)
	OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)
	OpenAvatarFile(path string) (*os.File, error)
	MkdirAll(path string) error
	Remove(path string) error
	RemoveAll(path string) error
	Rename(oldPath, newPath string) error
	Chtimes(path string, atime time.Time, mtime time.Time) error
	FileExists(path string) bool
	EnsureDirExist(path string)
	PathToInode(path string) uint64
	InodeToPath(inode uint64) string
	InodeToFileInfo(inode uint64) *sdkdto.FileInfoRes
	InodesToFileInfos(inodes ...uint64) map[uint64]*sdkdto.FileInfoRes
	Destroy()
	Exec(f func(*gorm.DB) error) error
}

type KV

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

func NewKV

func NewKV(appCode *string) *KV

func (*KV) Close

func (kv *KV) Close()

func (*KV) DeleteKV

func (kv *KV) DeleteKV(ugn *utils.UserGroupNamespace, kvType, key string) error

func (*KV) GetKV

func (kv *KV) GetKV(ugn *utils.UserGroupNamespace, kvType, key string) (*sdkdto.KV, bool)

func (*KV) Name

func (kv *KV) Name() string

func (*KV) PutKV

func (kv *KV) PutKV(ugn *utils.UserGroupNamespace, kvType, key, value string) error

type Message

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

func NewMessage

func NewMessage(appCode *string, nc *nats.Conn) *Message

func (*Message) AddHandler

func (m *Message) AddHandler(desc string, triggerPhrasePerl string, handler func(ugn *utils.UserGroupNamespace, content, uuid string) (reply bool, replyContent string, replyToUUID bool))

AddHandler 添加消息机器人处理器 desc:

消息机器人的功能描述

triggerPhrasePerl:

触发处理器的短语模式正则

handler func(content string) (reply bool, replyContent string, replyToUUID bool):

入参:
	- content 用户发送到机器人的消息正文
返回值:
	- reply 		:	是否需要回复
	- replyContent	:	回复的正文
	- replyToUUID	:	回复时是否引用用户消息

func (*Message) Close

func (m *Message) Close()

func (*Message) Name

func (m *Message) Name() string

func (*Message) SendMsg

func (m *Message) SendMsg(ugn *utils.UserGroupNamespace, content, replyUUID string) error

SendMsg 发送消息给用户,只有权限发送给拥有此app的用户 ugn : 用户与空间 content : 消息正文

type MessageEvent

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 Milvus added in v0.7.0

type Milvus struct {
	client.Client
	// contains filtered or unexported fields
}

Milvus vector database

func NewMilvus added in v0.7.0

func NewMilvus(appCode *string) (*Milvus, error)

func (*Milvus) Close added in v0.7.0

func (m *Milvus) Close()

func (*Milvus) GenCollectionName added in v0.7.0

func (m *Milvus) GenCollectionName(buzName string) string

GenCollectionName generate the collection name

func (*Milvus) GenPartitionName added in v0.7.0

func (m *Milvus) GenPartitionName(ugn *utils.UserGroupNamespace) string

GenPartitionName generate the partition name

func (*Milvus) LoadAppCollection added in v0.7.0

func (m *Milvus) LoadAppCollection(ugn *utils.UserGroupNamespace, collectionName string, expireTime ...time.Duration) (err error)

LoadAppCollection load app collection and set the expiration time

func (*Milvus) Name added in v0.7.0

func (m *Milvus) Name() string

type Schedule

type Schedule struct {
	Handler map[string]ScheduleEventHandler
	// contains filtered or unexported fields
}

func NewSchedule

func NewSchedule(appCode *string) *Schedule

func (*Schedule) AddCronScheduleEvent

func (s *Schedule) AddCronScheduleEvent(ugn *utils.UserGroupNamespace, name string, payload []byte, cron string) (err error, eventId *int64)

func (*Schedule) AddOnceScheduleEvent

func (s *Schedule) AddOnceScheduleEvent(ugn *utils.UserGroupNamespace, name string, payload []byte, remindTime int64) (err error, eventId *int64)

func (*Schedule) Close

func (s *Schedule) Close()

func (*Schedule) Name

func (s *Schedule) Name() string

func (*Schedule) SetHandler

func (s *Schedule) SetHandler(shs ...ScheduleEventHandler)

func (*Schedule) UpdateCronScheduleEvent

func (s *Schedule) UpdateCronScheduleEvent(ugn *utils.UserGroupNamespace, eventId int64, cron string) (err error)

func (*Schedule) UpdateOnceScheduleEvent

func (s *Schedule) UpdateOnceScheduleEvent(ugn *utils.UserGroupNamespace, eventId int64, remindTime int64) (err error)

type ScheduleEvent

type ScheduleEvent struct {
	UGN        utils.UserGroupNamespace `json:"ugn"`
	RemindTime int64                    `json:"remindTime"`
	Name       string                   `json:"name"`
	Payload    []byte                   `json:"payload"`
}

type ScheduleEventHandler

type ScheduleEventHandler struct {
	Name    string
	Handler func(se *ScheduleEvent)
}

type SyyFS

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

func (*SyyFS) Chtimes

func (fs *SyyFS) Chtimes(path string, atime time.Time, mtime time.Time) error

Chtimes 修改文件时间

func (*SyyFS) Destroy

func (fs *SyyFS) Destroy()

func (*SyyFS) EnsureDirExist

func (fs *SyyFS) EnsureDirExist(path string)

EnsureDirExist 确保目录存在

func (*SyyFS) Exec

func (fs *SyyFS) Exec(f func(*gorm.DB) error) error

Exec fs执行sql

func (*SyyFS) FileExists

func (fs *SyyFS) FileExists(path string) bool

FileExists 文件是否存在

func (*SyyFS) InodeToFileInfo

func (fs *SyyFS) InodeToFileInfo(inode uint64) *sdkdto.FileInfoRes

InodeToFileInfo inode转fileInfo

func (*SyyFS) InodeToPath

func (fs *SyyFS) InodeToPath(inode uint64) string

InodeToPath inode转path

func (*SyyFS) InodesToFileInfos

func (fs *SyyFS) InodesToFileInfos(inodes ...uint64) map[uint64]*sdkdto.FileInfoRes

InodesToFileInfos inodes转fileInfos

func (*SyyFS) MkdirAll

func (fs *SyyFS) MkdirAll(path string) error

MkdirAll 递归创建目录

func (*SyyFS) Open

func (fs *SyyFS) Open(path string) (*os.File, error)

Open 打开文件

func (*SyyFS) OpenAvatarFile

func (fs *SyyFS) OpenAvatarFile(path string) (*os.File, error)

func (*SyyFS) OpenByInode

func (fs *SyyFS) OpenByInode(inode uint64) (*os.File, error)

OpenByInode 根据inode打开文件

func (*SyyFS) OpenFile

func (fs *SyyFS) OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)

OpenFile 打开或创建文件

func (*SyyFS) PathToInode

func (fs *SyyFS) PathToInode(path string) uint64

PathToInode path转inode

func (*SyyFS) Remove

func (fs *SyyFS) Remove(path string) error

Remove 删除文件或空目录

func (*SyyFS) RemoveAll

func (fs *SyyFS) RemoveAll(path string) error

RemoveAll 删除文件或文件夹(包括子目录)

func (*SyyFS) Rename

func (fs *SyyFS) Rename(oldPath, newPath string) error

Rename 重命名文件

Jump to

Keyboard shortcuts

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