ability

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppPrefix = "/.siyouyun/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, ufi string) (*sdkdto.FFmpegBasicInfo, error)

func (*FFmpeg) GetDetailInfo

func (ff *FFmpeg) GetDetailInfo(ugn *utils.UserGroupNamespace, ufi 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) NewFSFromCtx

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

func (*FS) NewFSFromUserGroupNamespace

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

type File added in v0.8.0

type File interface {
	io.Closer
	io.Reader
	io.ReaderAt
	io.Seeker
	io.Writer
	io.WriterAt

	Name() string
	Readdir(count int) ([]*sdkdto.SiyouFileInfo, error)
	Readdirnames(n int) ([]string, error)
	Stat() (*sdkdto.SiyouFileInfo, error)
	Sync() error
	Truncate(size int64) error
	WriteString(s string) (ret int, err error)
}

type FileEventMonitor added in v0.9.11

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

func NewFileEventMonitor added in v0.9.11

func NewFileEventMonitor(appCode *string, nc *nats.Conn, preferOps ...sdkdto.PreferOptions) *FileEventMonitor

func (*FileEventMonitor) Close added in v0.9.11

func (m *FileEventMonitor) Close()

func (*FileEventMonitor) Name added in v0.9.11

func (m *FileEventMonitor) Name() string

type GenericFS

type GenericFS interface {
	GetUGN() *utils.UserGroupNamespace
	GetDB() *gorm.DB
	Open(ufi string) (File, error)
	OpenFile(ufi string, flag int, perm os.FileMode) (File, error)
	OpenAvatarFile(ufi string) (File, error)
	Stat(ufi string) (*sdkdto.SiyouFileInfo, error)
	MkdirAll(ufi string) error
	Remove(ufi string) error
	RemoveAll(ufi string) error
	Rename(oldUFI string, newUFI string) error
	Chtimes(ufi string, atime time.Time, mtime time.Time) error
	FileExists(ufi string) bool
	Exec(f func(*gorm.DB) error) error
	AppOpenFile(path string, flag int, perm os.FileMode) (File, error)
	AppMkdirAll(path string) error
	AppRemoveAll(path string) error
	AppFileExists(path string) bool
}

type HTTPFile added in v0.8.0

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

HTTPFile file implement by http

func (*HTTPFile) Close added in v0.8.0

func (H *HTTPFile) Close() error

func (*HTTPFile) Name added in v0.8.0

func (H *HTTPFile) Name() string

func (*HTTPFile) Read added in v0.8.0

func (H *HTTPFile) Read(p []byte) (int, error)

func (*HTTPFile) ReadAt added in v0.8.0

func (H *HTTPFile) ReadAt(p []byte, off int64) (int, error)

func (*HTTPFile) Readdir added in v0.8.0

func (H *HTTPFile) Readdir(n int) ([]*sdkdto.SiyouFileInfo, error)

func (*HTTPFile) Readdirnames added in v0.8.0

func (H *HTTPFile) Readdirnames(n int) ([]string, error)

func (*HTTPFile) Seek added in v0.8.0

func (H *HTTPFile) Seek(offset int64, whence int) (int64, error)

func (*HTTPFile) Stat added in v0.8.0

func (H *HTTPFile) Stat() (*sdkdto.SiyouFileInfo, error)

func (*HTTPFile) Sync added in v0.8.0

func (H *HTTPFile) Sync() error

func (*HTTPFile) Truncate added in v0.8.0

func (H *HTTPFile) Truncate(size int64) error

func (*HTTPFile) Write added in v0.8.0

func (H *HTTPFile) Write(p []byte) (int, error)

func (*HTTPFile) WriteAt added in v0.8.0

func (H *HTTPFile) WriteAt(p []byte, off int64) (int, error)

func (*HTTPFile) WriteString added in v0.8.0

func (H *HTTPFile) WriteString(s string) (int, error)

type IMigrator added in v0.9.11

type IMigrator interface {
	// Migrate everything you want, schema or data
	Migrate(ugn *utils.UserGroupNamespace) 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 Migrator added in v0.9.11

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

func NewMigrator added in v0.9.11

func NewMigrator(fs *FS, appInfo *sdkdto.AppRegisterInfo, nc *nats.Conn, handler IMigrator) *Migrator

func (*Migrator) Close added in v0.9.11

func (m *Migrator) Close()

func (*Migrator) Name added in v0.9.11

func (m *Migrator) 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
}

SyyFS syy fs operations

func (*SyyFS) AppFileExists added in v0.8.0

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

func (*SyyFS) AppMkdirAll added in v0.8.0

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

func (*SyyFS) AppOpenFile added in v0.8.0

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

func (*SyyFS) AppRemoveAll added in v0.8.0

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

func (*SyyFS) Chtimes

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

func (*SyyFS) Exec

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

func (*SyyFS) FileExists

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

func (*SyyFS) GetDB added in v0.9.4

func (fs *SyyFS) GetDB() *gorm.DB

func (*SyyFS) GetUGN added in v0.9.1

func (fs *SyyFS) GetUGN() *utils.UserGroupNamespace

func (*SyyFS) MkdirAll

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

func (*SyyFS) Open

func (fs *SyyFS) Open(ufi string) (File, error)

func (*SyyFS) OpenAvatarFile

func (fs *SyyFS) OpenAvatarFile(ufi string) (File, error)

OpenAvatarFile open avatar file

func (*SyyFS) OpenFile

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

OpenFile open file with privilege

func (*SyyFS) Remove

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

func (*SyyFS) RemoveAll

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

func (*SyyFS) Rename

func (fs *SyyFS) Rename(oldUFI string, newUFI string) error

func (*SyyFS) Stat added in v0.9.1

func (fs *SyyFS) Stat(ufi string) (*sdkdto.SiyouFileInfo, error)

Jump to

Keyboard shortcuts

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