metastore

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemoryMeta   = config.MemoryMeta
	SqliteMeta   = config.SqliteMeta
	PostgresMeta = config.PostgresMeta
)

Variables

This section is empty.

Functions

func DisableMetrics

func DisableMetrics()

Types

type AccessToken

type AccessToken interface {
	GetAccessToken(ctx context.Context, tokenKey string, secretKey string) (*types.AccessToken, error)
	CreateAccessToken(ctx context.Context, token *types.AccessToken) error
	UpdateAccessTokenCerts(ctx context.Context, token *types.AccessToken) error
	RevokeAccessToken(ctx context.Context, tokenKey string) error
}

type ChunkStore

type ChunkStore interface {
	NextSegmentID(ctx context.Context) (int64, error)
	ListSegments(ctx context.Context, oid, chunkID int64, allChunk bool) ([]types.ChunkSeg, error)
	AppendSegments(ctx context.Context, seg types.ChunkSeg) (*types.Metadata, error)
	DeleteSegment(ctx context.Context, segID int64) error
}

type DEntry

type DEntry interface {
	GetEntry(ctx context.Context, id int64) (*types.Metadata, error)
	FindEntry(ctx context.Context, parentID int64, name string) (*types.Metadata, error)
	CreateEntry(ctx context.Context, parentID int64, newEntry *types.Metadata, ed *types.ExtendData) error
	RemoveEntry(ctx context.Context, parentID, entryID int64) error
	DeleteRemovedEntry(ctx context.Context, entryID int64) error
	UpdateEntryMetadata(ctx context.Context, entry *types.Metadata) error

	SaveEntryUri(ctx context.Context, entryUri *types.EntryUri) error
	GetEntryUri(ctx context.Context, uri string) (*types.EntryUri, error)

	ListEntryChildren(ctx context.Context, parentId int64, order *types.EntryOrder, filters ...types.Filter) (EntryIterator, error)
	ListDocumentGroups(ctx context.Context, parentId int64, filter types.DocFilter) (EntryIterator, error)
	FilterEntries(ctx context.Context, filter types.Filter) (EntryIterator, error)

	Open(ctx context.Context, id int64, attr types.OpenAttr) (*types.Metadata, error)
	Flush(ctx context.Context, id int64, size int64) error
	MirrorEntry(ctx context.Context, newEntry *types.Metadata) error
	ChangeEntryParent(ctx context.Context, targetEntryId int64, newParentId int64, newName string, opt types.ChangeParentAttr) error

	GetEntryExtendData(ctx context.Context, id int64) (types.ExtendData, error)
	UpdateEntryExtendData(ctx context.Context, id int64, ed types.ExtendData) error

	GetEntryLabels(ctx context.Context, id int64) (types.Labels, error)
	UpdateEntryLabels(ctx context.Context, id int64, labels types.Labels) error
	ListEntryProperties(ctx context.Context, id int64) (types.Properties, error)
	GetEntryProperty(ctx context.Context, id int64, key string) (types.PropertyItem, error)
	AddEntryProperty(ctx context.Context, id int64, key string, item types.PropertyItem) error
	RemoveEntryProperty(ctx context.Context, id int64, key string) error
	UpdateEntryProperties(ctx context.Context, id int64, properties types.Properties) error

	SaveDocument(ctx context.Context, doc *types.Document) error
	ListDocument(ctx context.Context, filter types.DocFilter, order *types.DocumentOrder) ([]*types.Document, error)
	GetDocument(ctx context.Context, id int64) (*types.Document, error)
	GetDocumentByEntryId(ctx context.Context, oid int64) (*types.Document, error)
	GetDocumentByName(ctx context.Context, name string) (*types.Document, error)
	DeleteDocument(ctx context.Context, id int64) error

	ListFridayAccount(ctx context.Context, refId int64) ([]*types.FridayAccount, error)
	CreateFridayAccount(ctx context.Context, account *types.FridayAccount) error

	SaveRoom(ctx context.Context, room *types.Room) error
	GetRoom(ctx context.Context, id int64) (*types.Room, error)
	FindRoom(ctx context.Context, entryId int64) (*types.Room, error)
	DeleteRoom(ctx context.Context, id int64) error
	ListRooms(ctx context.Context, entryId int64) ([]*types.Room, error)
	ListRoomMessage(ctx context.Context, roomId int64) ([]*types.RoomMessage, error)
	SaveRoomMessage(ctx context.Context, msg *types.RoomMessage) error
	GetRoomMessage(ctx context.Context, msgId int64) (*types.RoomMessage, error)
	DeleteRoomMessages(ctx context.Context, roomId int64) error
}

type EntryIterator

type EntryIterator interface {
	HasNext() bool
	Next() *types.Metadata
}

type Meta

func NewMetaStorage

func NewMetaStorage(metaType string, meta config.Meta) (m Meta, err error)

type NotificationRecorder

type NotificationRecorder interface {
	ListNotifications(ctx context.Context) ([]types.Notification, error)
	RecordNotification(ctx context.Context, nid string, no types.Notification) error
	UpdateNotificationStatus(ctx context.Context, nid, status string) error

	RecordEvents(ctx context.Context, events []types.Event) error
	ListEvents(ctx context.Context, filter types.EventFilter) ([]types.Event, error)
	DeviceSync(ctx context.Context, deviceID string, syncedSequence int64) error
}

type ScheduledTaskRecorder

type ScheduledTaskRecorder interface {
	ListTask(ctx context.Context, taskID string, filter types.ScheduledTaskFilter) ([]*types.ScheduledTask, error)
	SaveTask(ctx context.Context, task *types.ScheduledTask) error
	DeleteFinishedTask(ctx context.Context, aliveTime time.Duration) error

	GetWorkflow(ctx context.Context, wfID string) (*types.WorkflowSpec, error)
	ListGlobalWorkflow(ctx context.Context) ([]*types.WorkflowSpec, error)
	ListWorkflow(ctx context.Context) ([]*types.WorkflowSpec, error)
	DeleteWorkflow(ctx context.Context, wfID string) error
	GetWorkflowJob(ctx context.Context, jobID string) (*types.WorkflowJob, error)
	ListWorkflowJob(ctx context.Context, filter types.JobFilter) ([]*types.WorkflowJob, error)
	SaveWorkflow(ctx context.Context, wf *types.WorkflowSpec) error
	SaveWorkflowJob(ctx context.Context, wf *types.WorkflowJob) error
	DeleteWorkflowJob(ctx context.Context, wfJobID ...string) error
}

type SysConfig

type SysConfig interface {
	SystemInfo(ctx context.Context) (*types.SystemInfo, error)
	GetConfigValue(ctx context.Context, group, name string) (string, error)
	SetConfigValue(ctx context.Context, group, name, value string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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