repoimpl

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBBoltAsset

func NewBBoltAsset(b *bolt.DB) repository.Asset

func NewBBoltTag

func NewBBoltTag(b *bolt.DB) repository.Tag

func NewBBoltWorkSpace

func NewBBoltWorkSpace(b *bolt.DB) repository.WorkSpace

func NewBoltMeta

func NewBoltMeta(b *bolt.DB) repository.Meta

Types

type BBoltAsset

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

func (*BBoltAsset) Add

func (b *BBoltAsset) Add(ws model.WSName, asset *model.Asset) (model.AssetID, error)

func (*BBoltAsset) AddByFilePathIfDoesNotExist

func (b *BBoltAsset) AddByFilePathIfDoesNotExist(ws model.WSName, filePath string) (model.AssetID, bool, error)

func (*BBoltAsset) AddByFilePathListIfDoesNotExist

func (b *BBoltAsset) AddByFilePathListIfDoesNotExist(ws model.WSName, filePathList []string) ([]model.AssetID, error)

func (*BBoltAsset) BatchAdd added in v0.1.1

func (b *BBoltAsset) BatchAdd(ws model.WSName, assets []*model.Asset) ([]model.AssetID, error)

BatchAdd add Assets. provided assets must not have ID and must have path. If asset does not satisfy them, error will be returned.

func (*BBoltAsset) BatchUpdateByID added in v0.1.3

func (b *BBoltAsset) BatchUpdateByID(ws model.WSName, assets []*model.Asset) (updatedAssets, skippedAssets []*model.Asset, err error)

BatchUpdate update assets by ID. Invalid asset will be skip. For example, an asset that contains a bounding box that does not have an ID.

func (*BBoltAsset) BatchUpdateByPath added in v0.1.3

func (b *BBoltAsset) BatchUpdateByPath(ws model.WSName, assets []*model.Asset) (updatedAssets, skippedAssets []*model.Asset, err error)

BatchUpdateByPath update assets by path. Invalid asset will be skip. For example, an asset that contains a bounding box that does not have an ID. If asset which have non exist path is provided, it will be ignored.

func (*BBoltAsset) Close added in v0.1.3

func (b *BBoltAsset) Close() error

func (*BBoltAsset) Delete

func (b *BBoltAsset) Delete(ws model.WSName, id model.AssetID) error

func (*BBoltAsset) ForEach

func (b *BBoltAsset) ForEach(ws model.WSName, f func(asset *model.Asset) error) error

func (*BBoltAsset) Get

func (b *BBoltAsset) Get(ws model.WSName, id model.AssetID) (asset *model.Asset, exist bool, err error)

func (*BBoltAsset) GetByPath

func (b *BBoltAsset) GetByPath(ws model.WSName, path string) (asset *model.Asset, exist bool, err error)

func (*BBoltAsset) Has

func (b *BBoltAsset) Has(ws model.WSName, id model.AssetID) (ok bool, err error)

func (*BBoltAsset) Init

func (b *BBoltAsset) Init(ws model.WSName) error

func (*BBoltAsset) List

func (b *BBoltAsset) List(ws model.WSName) (assets []*model.Asset, err error)

func (*BBoltAsset) ListAsync added in v0.1.3

func (b *BBoltAsset) ListAsync(ctx context.Context, ws model.WSName, cap int) (assetChan <-chan *model.Asset, err error)

func (*BBoltAsset) ListBy

func (b *BBoltAsset) ListBy(ws model.WSName, f func(asset *model.Asset) bool) (assets []*model.Asset, err error)

func (*BBoltAsset) ListByAsync

func (b *BBoltAsset) ListByAsync(ctx context.Context, ws model.WSName, f func(asset *model.Asset) bool, cap int) (assetChan <-chan *model.Asset, err error)

func (*BBoltAsset) ListByIDList added in v0.1.3

func (b *BBoltAsset) ListByIDList(ws model.WSName, idList []model.AssetID) (assets []*model.Asset, err error)

ListByIDList list assets by provided ID ID list. If ID which does not exist is provided, nil will be returned.

func (*BBoltAsset) ListByIDListAsync added in v0.1.3

func (b *BBoltAsset) ListByIDListAsync(ctx context.Context, ws model.WSName, idList []model.AssetID, cap int) (assetChan <-chan *model.Asset, errChan <-chan error, err error)

func (*BBoltAsset) ListByPaths added in v0.1.3

func (b *BBoltAsset) ListByPaths(ws model.WSName, paths []string) (assets []*model.Asset, err error)

func (*BBoltAsset) ListByTags

func (b *BBoltAsset) ListByTags(ws model.WSName, tags []model.UnindexedTag) (assets []*model.Asset, err error)

func (*BBoltAsset) ListRawByAsync

func (b *BBoltAsset) ListRawByAsync(ctx context.Context, ws model.WSName, f func(v []byte) bool, cap int) (vc <-chan []byte, err error)

func (*BBoltAsset) Revalidate

func (b *BBoltAsset) Revalidate(ws model.WSName) error

func (*BBoltAsset) Update

func (b *BBoltAsset) Update(ws model.WSName, asset *model.Asset) error

Update updates asset by ID. if data which have ID does not exist, return error.

type BBoltBaseTag added in v0.1.4

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

func NewBBoltBaseTag added in v0.1.4

func NewBBoltBaseTag(b *bolt.DB, bucketName string) *BBoltBaseTag

func (*BBoltBaseTag) Add added in v0.1.4

func (b *BBoltBaseTag) Add(ws model.WSName, unregisteredTag *model.UnregisteredUnindexedTag) (*model.Tag, error)

func (*BBoltBaseTag) AddByName added in v0.1.4

func (b *BBoltBaseTag) AddByName(ws model.WSName, tagName string) (*model.Tag, bool, error)

func (*BBoltBaseTag) AddByNames added in v0.1.4

func (b *BBoltBaseTag) AddByNames(ws model.WSName, tagNames []string) ([]*model.Tag, error)

AddByNames adds tags which have provided names. Then returns ID list of created tags. If tag which have same name exists, do nothing and return the exist tag ID. For example, assume that ["tag1", "tag2", "tag3"] are provided as tagNames, and "tag2" already exist with ID=1. In this case, return values is [2,1,3].

func (*BBoltBaseTag) AddWithIndex added in v0.1.4

func (b *BBoltBaseTag) AddWithIndex(ws model.WSName, unregisteredTagWithIndex *model.UnregisteredTag) (*model.Tag, error)

func (*BBoltBaseTag) Delete added in v0.1.4

func (b *BBoltBaseTag) Delete(ws model.WSName, idList []model.TagID) error

Delete deletes tags which have provided ID. Internally, even if tag is deleted, it still reserved on tag bucket with `deleted` flag.

func (*BBoltBaseTag) ForEach added in v0.1.4

func (b *BBoltBaseTag) ForEach(ws model.WSName, f func(tagWithIndex *model.Tag) error) error

func (*BBoltBaseTag) Get added in v0.1.4

func (b *BBoltBaseTag) Get(ws model.WSName, id model.TagID) (tagWithIndex *model.Tag, exist bool, err error)

func (*BBoltBaseTag) ListAll added in v0.1.4

func (b *BBoltBaseTag) ListAll(ws model.WSName) (assets []*model.Tag, err error)

func (*BBoltBaseTag) ListAsSet added in v0.1.4

func (b *BBoltBaseTag) ListAsSet(ws model.WSName) (set *model.TagSet, err error)

func (*BBoltBaseTag) ListBy added in v0.1.4

func (b *BBoltBaseTag) ListBy(ws model.WSName, f func(tag *model.Tag) bool) (assets []*model.Tag, err error)

func (*BBoltBaseTag) ListByAsync added in v0.1.4

func (b *BBoltBaseTag) ListByAsync(ws model.WSName, f func(tagWithIndex *model.Tag) bool, cap int) (assetChan <-chan *model.Tag, err error)

func (*BBoltBaseTag) Save added in v0.1.4

func (b *BBoltBaseTag) Save(ws model.WSName, tagWithIndex *model.Tag) (*model.Tag, error)

Save saves tag to bolt. If a tag with the same ID is already exists, update it by provided tag. If tag does not exist yet, add provided tag. If tag which has same name exists on tag history but different ID, return error.

type BBoltTag

type BBoltTag struct {
	*BBoltBaseTag
	// contains filtered or unexported fields
}

func (*BBoltTag) AddByName added in v0.1.1

func (b *BBoltTag) AddByName(ws model.WSName, tagName string) (*model.Tag, bool, error)

func (*BBoltTag) AddByNames added in v0.1.1

func (b *BBoltTag) AddByNames(ws model.WSName, tagNames []string) ([]*model.Tag, error)

AddByNames adds tags which have provided names. Then returns ID list of created tags. If tag which have same name exists, do nothing and return the exist tag ID. For example, assume that ["tag1", "tag2", "tag3"] are provided as tagNames, and "tag2" already exist with ID=1. In this case, return values is [2,1,3].

func (*BBoltTag) AddWithIndex added in v0.1.4

func (b *BBoltTag) AddWithIndex(ws model.WSName, tagWithIndex *model.UnregisteredTag) (*model.Tag, error)

func (*BBoltTag) Init

func (b *BBoltTag) Init(ws model.WSName) error

type BBoltWorkSpace

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

func (*BBoltWorkSpace) Add

func (b *BBoltWorkSpace) Add(ws *model.WorkSpace) error

func (*BBoltWorkSpace) Init

func (b *BBoltWorkSpace) Init() error

func (*BBoltWorkSpace) List

func (b *BBoltWorkSpace) List() (workspaces []*model.WorkSpace, err error)

func (*BBoltWorkSpace) Update

func (b *BBoltWorkSpace) Update(ws *model.WorkSpace) error

type BoltMeta

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

func (*BoltMeta) GetDBVersion

func (b *BoltMeta) GetDBVersion() (v *semver.Version, exist bool, err error)

func (*BoltMeta) Init

func (b *BoltMeta) Init() error

func (*BoltMeta) SetDBVersion

func (b *BoltMeta) SetDBVersion(version *semver.Version) error

Jump to

Keyboard shortcuts

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