controller

package
v0.5.0-beta Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRssPluginScopeFromURL

func BuildRssPluginScopeFromURL(url string) (types.ExtendData, error)

Types

type Controller

type Controller interface {
	LoadRootEntry(ctx context.Context) (*types.Metadata, error)
	FindEntry(ctx context.Context, parentId int64, name string) (*types.Metadata, error)
	GetEntry(ctx context.Context, id int64) (*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) ([]*types.Metadata, error)
	ChangeEntryParent(ctx context.Context, targetId, oldParentId, newParentId int64, newName string, opt types.ChangeParentAttr) error

	GetEntryExtendField(ctx context.Context, id int64, fKey string) ([]byte, error)
	SetEntryExtendField(ctx context.Context, id int64, fKey string, fVal []byte) error
	RemoveEntryExtendField(ctx context.Context, id int64, fKey string) error
	ConfigEntrySourcePlugin(ctx context.Context, id int64, scope types.ExtendData) error
	CleanupEntrySourcePlugin(ctx context.Context, id int64) error

	EnableGroupFeed(ctx context.Context, id int64, feedID string) error
	DisableGroupFeed(ctx context.Context, id int64) error
	GetDocumentsByFeed(ctx context.Context, feedId string, count int) (*types.FeedResult, error)
	GetDocumentsByEntryId(ctx context.Context, entryId int64) (*types.Document, error)
	QueryDocuments(ctx context.Context, query string) ([]*types.Document, 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

	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