controller

package
v0.6.0-beta Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	AccessToken(ctx context.Context, ak, sk string) (*types.AccessToken, error)
	CreateNamespace(ctx context.Context, namespace string) (*types.Namespace, error)

	LoadRootEntry(ctx context.Context) (*types.Metadata, error)
	GetGroupTree(ctx context.Context) (*types.GroupEntry, error)
	FindEntry(ctx context.Context, parentId int64, name string) (*types.Metadata, error)
	GetEntry(ctx context.Context, id int64) (*types.Metadata, error)
	GetEntryByURI(ctx context.Context, uri string) (*types.Metadata, error)
	CreateEntry(ctx context.Context, parentId int64, attr types.EntryAttr) (*types.Metadata, error)
	UpdateEntry(ctx context.Context, entry *types.Metadata) error
	DestroyEntry(ctx context.Context, parentId, entryId int64, attr types.DestroyObjectAttr) error
	MirrorEntry(ctx context.Context, srcEntryId, dstParentId int64, attr types.EntryAttr) (*types.Metadata, error)
	ListEntryChildren(ctx context.Context, entryId int64, order *types.EntryOrder, filters ...types.Filter) ([]*types.Metadata, error)
	ChangeEntryParent(ctx context.Context, targetId, oldParentId, newParentId int64, newName string, opt types.ChangeParentAttr) error
	ListDocumentGroups(ctx context.Context, parentId int64, filter types.DocFilter) ([]*types.Metadata, error)

	ConfigEntrySourcePlugin(ctx context.Context, id int64, scope types.ExtendData) error
	CleanupEntrySourcePlugin(ctx context.Context, id int64) error

	ListEntryProperties(ctx context.Context, id int64) (map[string]types.PropertyItem, error)
	GetEntryProperty(ctx context.Context, id int64, fKey string) ([]byte, error)
	SetEntryProperty(ctx context.Context, id int64, fKey, fVal string) error
	SetEntryEncodedProperty(ctx context.Context, id int64, fKey string, fVal []byte) error
	RemoveEntryProperty(ctx context.Context, id int64, fKey string) error

	QuickInbox(ctx context.Context, filename string, option inbox.Option) (*types.Metadata, error)

	GetLatestSequence(ctx context.Context) (int64, error)
	ListUnSyncedEvent(ctx context.Context, sequence int64) ([]types.Event, error)
	CommitSyncedEvent(ctx context.Context, deviceID string, sequence int64) error
	ListNotifications(ctx context.Context) ([]types.Notification, error)

	ListDocuments(ctx context.Context, filter types.DocFilter, order *types.DocumentOrder) ([]*types.Document, error)
	GetDocumentsByEntryId(ctx context.Context, entryId int64) (*types.Document, error)
	GetDocument(ctx context.Context, documentId int64) (*types.Document, error)
	QueryDocuments(ctx context.Context, query string) ([]*types.Document, error)
	UpdateDocument(ctx context.Context, doc *types.Document) error

	ListRooms(ctx context.Context, entryId int64) ([]*types.Room, error)
	CreateRoom(ctx context.Context, entryId int64, prompt string) (*types.Room, error)
	GetRoom(ctx context.Context, id int64) (*types.Room, error)
	FindRoom(ctx context.Context, entryId int64) (*types.Room, error)
	UpdateRoom(ctx context.Context, roomId int64, prompt string) error
	DeleteRoom(ctx context.Context, id int64) error
	ClearRoom(ctx context.Context, id int64) error
	ChatInRoom(ctx context.Context, roomId int64, newMsg string, reply chan types.ReplyChannel) (err error)
	CreateRoomMessage(ctx context.Context, roomID int64, sender, msg string, sendAt time.Time) (*types.RoomMessage, error)

	OpenFile(ctx context.Context, entryId int64, attr types.OpenAttr) (dentry.File, error)
	ReadFile(ctx context.Context, file dentry.File, data []byte, offset int64) (n int64, err error)
	WriteFile(ctx context.Context, file dentry.File, data []byte, offset int64) (n int64, err error)
	CloseFile(ctx context.Context, file dentry.File) error

	ListWorkflows(ctx context.Context) ([]*types.WorkflowSpec, error)
	GetWorkflow(ctx context.Context, wfId string) (*types.WorkflowSpec, error)
	CreateWorkflow(ctx context.Context, spec *types.WorkflowSpec) (*types.WorkflowSpec, error)
	UpdateWorkflow(ctx context.Context, spec *types.WorkflowSpec) (*types.WorkflowSpec, error)
	DeleteWorkflow(ctx context.Context, wfId string) error
	ListJobs(ctx context.Context, wfId string) ([]*types.WorkflowJob, error)
	GetJob(ctx context.Context, wfId string, jobID string) (*types.WorkflowJob, error)

	TriggerWorkflow(ctx context.Context, wfId string, tgt types.WorkflowTarget, attr workflow.JobAttr) (*types.WorkflowJob, error)
	PauseWorkflowJob(ctx context.Context, jobId string) error
	ResumeWorkflowJob(ctx context.Context, jobId string) error
	CancelWorkflowJob(ctx context.Context, jobId string) error

	FsInfo(ctx context.Context) Info
	StartBackendTask(stopCh chan struct{})
	SetupShutdownHandler(stopCh chan struct{}) chan struct{}
}

func New

func New(loader config.Loader, meta metastore.Meta) (Controller, error)

type Info

type Info struct {
	Objects     uint64
	FileCount   uint64
	AvailInodes uint64
	MaxSize     uint64
	UsageSize   uint64
}

Jump to

Keyboard shortcuts

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