Documentation ¶
Index ¶
- Variables
- func NewAsset(assetRepository repository.Asset, tag *client.Tag) usecase.Asset
- type Asset
- func (a *Asset) AddAssetFromImagePath(ws model.WSName, filePath string) (model.AssetID, error)
- func (a *Asset) AddAssetFromImagePathIfDoesNotExist(ws model.WSName, filePath string) (model.AssetID, bool, error)
- func (a *Asset) AddAssetFromImagePathListIfDoesNotExist(ws model.WSName, filePathList []string) ([]model.AssetID, error)
- func (a *Asset) AssignBoundingBox(ws model.WSName, assetID model.AssetID, box *model.BoundingBox) (*model.Asset, error)
- func (a *Asset) BatchUpdateByID(ws model.WSName, assets []*model.Asset, queries []*model.Query) (updatedAssets, filteredAssets, skippedAssets []*model.Asset, err error)
- func (a *Asset) BatchUpdateByPath(ws model.WSName, assets []*model.Asset, queries []*model.Query) (updatedAssets, filteredAssets, skippedAssets []*model.Asset, err error)
- func (a *Asset) DeleteBoundingBox(ws model.WSName, assetID model.AssetID, boxID model.BoundingBoxID) error
- func (a *Asset) Init(ws model.WSName) error
- func (a *Asset) ListAsyncByQueries(ctx context.Context, ws model.WSName, queries []*model.Query) (<-chan *model.Asset, error)
- func (a *Asset) ListAsyncWithFormat(wsName model.WSName, formatType string, capacity int) (<-chan string, <-chan error, error)
- func (a *Asset) ModifyBoundingBox(ws model.WSName, assetID model.AssetID, box *model.BoundingBox) (*model.Asset, error)
- func (a *Asset) ReadImportAssetsWithProgressBar(ws model.WSName, reader io.Reader, capacity int, ...) error
- func (a *Asset) SaveImportAssets(ws model.WSName, importAssets []*model.ImportAsset, queries []*model.Query) (addedAssets, updatedAssets, skippedAssets []*model.Asset, err error)
- func (a *Asset) SaveImportAssetsFromReader(ws model.WSName, reader io.Reader, capacity int, queries []*model.Query) error
- func (a *Asset) UnAssignBoundingBox(ws model.WSName, assetID model.AssetID, boxID model.BoundingBoxID) (*model.Asset, error)
- type AssetImportResult
- type Migration
- type Tag
- func (a *Tag) List(ws model.WSName) (tags []*model.Tag, err error)
- func (a *Tag) SaveTags(ws model.WSName, tags []*model.Tag) (newTags []*model.Tag, err error)
- func (a *Tag) SetTagByNames(ws model.WSName, tagNames []string) (tags []*model.Tag, err error)
- func (a *Tag) SetTags(ws model.WSName, tags []*model.UnindexedTag) (newTags []*model.Tag, err error)
- type UseCases
Constants ¶
This section is empty.
Variables ¶
var DefaultBasePath string
Functions ¶
Types ¶
type Asset ¶
type Asset struct {
// contains filtered or unexported fields
}
func (*Asset) AddAssetFromImagePath ¶
func (*Asset) AddAssetFromImagePathIfDoesNotExist ¶
func (*Asset) AddAssetFromImagePathListIfDoesNotExist ¶
func (*Asset) AssignBoundingBox ¶
func (a *Asset) AssignBoundingBox(ws model.WSName, assetID model.AssetID, box *model.BoundingBox) (*model.Asset, error)
AssignBoundingBox assign bounding box to asset
func (*Asset) BatchUpdateByID ¶ added in v0.1.6
func (a *Asset) BatchUpdateByID(ws model.WSName, assets []*model.Asset, queries []*model.Query) (updatedAssets, filteredAssets, skippedAssets []*model.Asset, err error)
BatchUpdateByID update by provided assets. If DB already has same ID asset, merge it and provided asset, then save the asset. If DB does not have same ID asset, do nothing and return as skippedAssets. queries can be nil. Only assets that match queries will be merged. Unmatched assets will be returned as filteredAssets.
func (*Asset) BatchUpdateByPath ¶ added in v0.1.6
func (a *Asset) BatchUpdateByPath(ws model.WSName, assets []*model.Asset, queries []*model.Query) (updatedAssets, filteredAssets, skippedAssets []*model.Asset, err error)
BatchUpdateByPath update by provided assets. If DB already has same ID asset, merge it and provided asset, then save the asset. If DB does not have same ID asset, do nothing and return as skippedAssets. queries can be nil. Only assets that match queries will be merged. Note: filteredAssets will be returned with updated properties, not original.
func (*Asset) DeleteBoundingBox ¶
func (*Asset) ListAsyncByQueries ¶
func (*Asset) ListAsyncWithFormat ¶
func (*Asset) ModifyBoundingBox ¶
func (*Asset) ReadImportAssetsWithProgressBar ¶
func (*Asset) SaveImportAssets ¶ added in v0.1.6
func (a *Asset) SaveImportAssets(ws model.WSName, importAssets []*model.ImportAsset, queries []*model.Query) (addedAssets, updatedAssets, skippedAssets []*model.Asset, err error)
SaveImportAssets updates assets by ID or path. If ID is specified, find asset by ID and update properties. (includes path if it specified) If ID is not specified and path is specified, find asset by path and update properties. Specified properties are updated and omitted properties are reserved. queries can be nil. Only assets that match queries will be merged.
func (*Asset) SaveImportAssetsFromReader ¶ added in v0.1.6
func (a *Asset) SaveImportAssetsFromReader(ws model.WSName, reader io.Reader, capacity int, queries []*model.Query) error
SaveImportAssetsFromReader updates by Id or path that provided from reader. If ID is specified, find asset by ID and update properties. (includes path if it specified) If ID is not specified and path is specified, find asset by path and update properties. Specified properties are updated and omitted properties are reserved. The number of assets specified by capacity is buffered and processed at one time. queries can be nil. Only assets that match queries will be merged.
type AssetImportResult ¶
type AssetImportResult struct { Asset *model.ImportAsset Err error }
type Migration ¶
type Migration struct {
// contains filtered or unexported fields
}
func NewMigration ¶
func NewMigration(assetRepository repository.Asset, metaRepository repository.Meta) *Migration
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
func (*Tag) SaveTags ¶
SaveTags persists tags and return saved tags. For each tag, if the tag already exists, update it. Otherwise add new tag with new ID. If model.Tag has non zero value but the tag which have the ID is not persisted, fail immediately and remain tags are not proceeded.
func (*Tag) SetTagByNames ¶
SetTagByNames set provided tags. All existing tags will be replaced. (Internally, this method recreate tag bucket)
type UseCases ¶
func New ¶
func New(asset repository.Asset, tag *client.Tag, workspace repository.WorkSpace, meta repository.Meta) *UseCases