siyouyunfaas

package module
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

README

siyouyun_sdk

Siyouyun FaaS Service SDK

Documentation

Index

Constants

View Source
const (
	FileEventAdd = iota + 1
	FileEventDelete
)
View Source
const (
	EventStatusError  = 3
	EventStatusFinish = 4
)
View Source
const (
	AppCodeEnvKey = "AppCode"
)

Variables

This section is empty.

Functions

func InodeToPath added in v0.1.7

func InodeToPath(app *App, un *utils.UserNamespace, inode int64) string

InodeToPath inode转fullpath

func PathToInode added in v0.1.7

func PathToInode(app *App, un *utils.UserNamespace, fullpath string) int64

PathToInode fullpath为用户空间的相对fullpath

Types

type App

type App struct {
	Api     SiyouFaasApi
	AppInfo *entity.AppRegisterInfo
	// contains filtered or unexported fields
}

func NewApp

func NewApp() *App

func (*App) Exec added in v0.1.3

func (a *App) Exec(ctx iris.Context, f func(*gorm.DB) error) error

type Edge added in v0.1.7

type Edge struct {
	Parent         int64
	Name           string
	Inode          int64
	PosixType      int
	MimeGroup      string
	MimeDetail     string
	FullPath       string
	FullParentPath string
}

type EventHolder added in v0.1.7

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

func NewEventHolder added in v0.1.7

func NewEventHolder(appName string) *EventHolder

NewEventHolder 初始化事件监听器

func (*EventHolder) Listen added in v0.1.7

func (e *EventHolder) Listen()

Listen 开始监听器工作

func (*EventHolder) SetPrefer added in v0.1.7

func (e *EventHolder) SetPrefer(options ...PreferOptions)

SetPrefer 设置偏好与回调函数

type FS added in v0.1.7

type FS struct {
	*utils.UserNamespace
	EventFileInode int64
	AppCodeName    string
	// contains filtered or unexported fields
}

func (*FS) AppOpen added in v0.1.7

func (efs *FS) AppOpen(path string) (*os.File, error)

func (*FS) AppOpenFile added in v0.1.7

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

func (*FS) AppRemove added in v0.1.7

func (efs *FS) AppRemove(path string) error

func (*FS) AppRename added in v0.1.7

func (efs *FS) AppRename(oldPath, newPath string) error

func (*FS) Open added in v0.1.7

func (efs *FS) Open(path string) (*os.File, error)

type FileEvent added in v0.1.7

type FileEvent struct {
	Inode     int64  `json:"inode,omitempty"`
	Action    int    `json:"action,omitempty"`
	Username  string `json:"username,omitempty"`
	Namespace string `json:"namespace,omitempty"`
}

type FileType added in v0.1.7

type FileType string

type PreferOptions added in v0.1.7

type PreferOptions struct {
	FileType      FileType
	FileEventType int
	Description   string
	Handler       func(fs *FS) error
}

type SiyouFaasApi

type SiyouFaasApi map[string]func(iris.Context)

func (SiyouFaasApi) Delete

func (api SiyouFaasApi) Delete(uri string, f func(iris.Context))

func (SiyouFaasApi) Exec

func (api SiyouFaasApi) Exec(uri string, ctx 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))

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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