repo

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedToLock  = errors.New("failed to lock")
	ErrAlreadyLocked = errors.New("already locked")
	ErrNotLocked     = errors.New("not locked")
)

Functions

func DatasetGraphLoaderFrom

func DatasetGraphLoaderFrom(r Dataset, scenes []id.SceneID) dataset.GraphLoader

func DatasetLoaderFrom

func DatasetLoaderFrom(r Dataset, scenes []id.SceneID) dataset.Loader

func IterateProjectsByTeam

func IterateProjectsByTeam(repo Project, ctx context.Context, tid id.TeamID, batch int, callback func([]*project.Project) error) error

func LayerLoaderBySceneFrom

func LayerLoaderBySceneFrom(r Layer) layer.LoaderByScene

func LayerLoaderFrom

func LayerLoaderFrom(r Layer, scenes []id.SceneID) layer.Loader

func PluginLoaderFrom

func PluginLoaderFrom(r Plugin) plugin.Loader

func PropertyLoaderFrom

func PropertyLoaderFrom(r Property, scenes []id.SceneID) property.Loader

func PropertySchemaLoaderFrom

func PropertySchemaLoaderFrom(r PropertySchema) property.SchemaLoader

func TagLoaderFrom added in v0.5.0

func TagLoaderFrom(r Tag, scenes []id.SceneID) tag.Loader

func TagSceneLoaderFrom added in v0.5.0

func TagSceneLoaderFrom(r Tag, scenes []id.SceneID) tag.SceneLoader

Types

type Asset

type Asset interface {
	Save(context.Context, *asset.Asset) error
	Remove(context.Context, id.AssetID) error
	FindByTeam(context.Context, id.TeamID, *usecase.Pagination) ([]*asset.Asset, *usecase.PageInfo, error)
	FindByID(context.Context, id.AssetID, []id.TeamID) (*asset.Asset, error)
	FindByIDs(context.Context, []id.AssetID, []id.TeamID) ([]*asset.Asset, error)
}

type Config

type Config interface {
	LockAndLoad(context.Context) (*config.Config, error)
	Save(context.Context, *config.Config) error
	SaveAndUnlock(context.Context, *config.Config) error
	Unlock(context.Context) error
}

type Container

type Container struct {
	Asset          Asset
	Config         Config
	DatasetSchema  DatasetSchema
	Dataset        Dataset
	Layer          Layer
	Plugin         Plugin
	Project        Project
	PropertySchema PropertySchema
	Property       Property
	Scene          Scene
	Tag            Tag
	Team           Team
	User           User
	SceneLock      SceneLock
	Transaction    Transaction
	Lock           Lock
}

type Layer

type Layer interface {
	FindByID(context.Context, id.LayerID, []id.SceneID) (layer.Layer, error)
	FindByIDs(context.Context, []id.LayerID, []id.SceneID) (layer.List, error)
	FindItemByID(context.Context, id.LayerID, []id.SceneID) (*layer.Item, error)
	FindItemByIDs(context.Context, []id.LayerID, []id.SceneID) (layer.ItemList, error)
	FindAllByDatasetSchema(context.Context, id.DatasetSchemaID) (layer.List, error)
	FindGroupByID(context.Context, id.LayerID, []id.SceneID) (*layer.Group, error)
	FindGroupByIDs(context.Context, []id.LayerID, []id.SceneID) (layer.GroupList, error)
	FindGroupBySceneAndLinkedDatasetSchema(context.Context, id.SceneID, id.DatasetSchemaID) (layer.GroupList, error)
	FindParentByID(context.Context, id.LayerID, []id.SceneID) (*layer.Group, error)
	FindParentsByIDs(context.Context, []id.LayerID, []id.SceneID) (layer.GroupList, error)
	FindByPluginAndExtension(context.Context, id.PluginID, *id.PluginExtensionID, []id.SceneID) (layer.List, error)
	FindByPluginAndExtensionOfBlocks(context.Context, id.PluginID, *id.PluginExtensionID, []id.SceneID) (layer.List, error)
	FindByProperty(context.Context, id.PropertyID, []id.SceneID) (layer.Layer, error)
	FindByScene(context.Context, id.SceneID) (layer.List, error)
	FindByTag(context.Context, id.TagID, []id.SceneID) (layer.List, error)
	Save(context.Context, layer.Layer) error
	SaveAll(context.Context, layer.List) error
	UpdatePlugin(context.Context, id.PluginID, id.PluginID, []id.SceneID) error
	Remove(context.Context, id.LayerID) error
	RemoveAll(context.Context, []id.LayerID) error
	RemoveByScene(context.Context, id.SceneID) error
}

type Lock added in v0.3.0

type Lock interface {
	Lock(context.Context, string) error
	Unlock(context.Context, string) error
}

type Plugin

type Plugin interface {
	FindByID(context.Context, id.PluginID, []id.SceneID) (*plugin.Plugin, error)
	FindByIDs(context.Context, []id.PluginID, []id.SceneID) ([]*plugin.Plugin, error)
	Save(context.Context, *plugin.Plugin) error
	Remove(context.Context, id.PluginID) error
}

type Scene

type Scene interface {
	FindByID(context.Context, id.SceneID, []id.TeamID) (*scene.Scene, error)
	FindByIDs(context.Context, []id.SceneID, []id.TeamID) ([]*scene.Scene, error)
	FindByProject(context.Context, id.ProjectID, []id.TeamID) (*scene.Scene, error)
	FindIDsByTeam(context.Context, []id.TeamID) ([]id.SceneID, error)
	HasSceneTeam(context.Context, id.SceneID, []id.TeamID) (bool, error)
	HasScenesTeam(context.Context, []id.SceneID, []id.TeamID) ([]bool, error)
	Save(context.Context, *scene.Scene) error
	Remove(context.Context, id.SceneID) error
}

type SceneLock

type SceneLock interface {
	GetLock(context.Context, id.SceneID) (scene.LockMode, error)
	GetAllLock(context.Context, []id.SceneID) ([]scene.LockMode, error)
	SaveLock(context.Context, id.SceneID, scene.LockMode) error
	ReleaseAllLock(context.Context) error
}

type Tag

type Tag interface {
	FindByID(context.Context, id.TagID, []id.SceneID) (tag.Tag, error)
	FindByIDs(context.Context, []id.TagID, []id.SceneID) ([]*tag.Tag, error)
	FindByScene(context.Context, id.SceneID) ([]*tag.Tag, error)
	FindItemByID(context.Context, id.TagID, []id.SceneID) (*tag.Item, error)
	FindItemByIDs(context.Context, []id.TagID, []id.SceneID) ([]*tag.Item, error)
	FindGroupByID(context.Context, id.TagID, []id.SceneID) (*tag.Group, error)
	FindGroupByIDs(context.Context, []id.TagID, []id.SceneID) ([]*tag.Group, error)
	FindRootsByScene(context.Context, id.SceneID) ([]*tag.Tag, error)
	FindGroupByItem(context.Context, id.TagID, []id.SceneID) (*tag.Group, error)
	Save(context.Context, tag.Tag) error
	SaveAll(context.Context, []*tag.Tag) error
	Remove(context.Context, id.TagID) error
	RemoveAll(context.Context, []id.TagID) error
	RemoveByScene(context.Context, id.SceneID) error
}

type Team

type Team interface {
	FindByUser(context.Context, id.UserID) ([]*user.Team, error)
	FindByIDs(context.Context, []id.TeamID) ([]*user.Team, error)
	FindByID(context.Context, id.TeamID) (*user.Team, error)
	Save(context.Context, *user.Team) error
	SaveAll(context.Context, []*user.Team) error
	Remove(context.Context, id.TeamID) error
	RemoveAll(context.Context, []id.TeamID) error
}

type Transaction

type Transaction interface {
	Begin() (Tx, error)
}

type Tx

type Tx interface {
	// Commit informs Tx to commit when End() is called.
	// If this was not called once, rollback is done when End() is called.
	Commit()
	// End finishes the transaction and do commit if Commit() was called once, or else do rollback.
	// This method is supposed to be called in the uscase layer using defer.
	End(context.Context) error
}

type User

type User interface {
	FindByIDs(context.Context, []id.UserID) ([]*user.User, error)
	FindByID(context.Context, id.UserID) (*user.User, error)
	FindByAuth0Sub(context.Context, string) (*user.User, error)
	FindByEmail(context.Context, string) (*user.User, error)
	FindByNameOrEmail(context.Context, string) (*user.User, error)
	Save(context.Context, *user.User) error
	Remove(context.Context, id.UserID) error
}

Jump to

Keyboard shortcuts

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