assetsvc

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterByIndex added in v0.1.6

func FilterByIndex(assets []*model.Asset, indices []int) (newAssets []*model.Asset)

func FilterNil

func FilterNil(assets []*model.Asset) (filteredAssets []*model.Asset)

func NilIndex added in v0.1.6

func NilIndex(assets []*model.Asset) (indices []int)

NilIndex return indices which position of nil no provided assets.

func Query added in v0.1.6

func Query(assets []*model.Asset, queries []*model.Query, tagSet *model.TagSet, matchToNil bool) (matchedAssets, filteredAssets []*model.Asset)

Query filter assets by queries and return matched assets. if asset is nil, it will be filtered.

func QueryIndex added in v0.1.6

func QueryIndex(assets []*model.Asset, queries []*model.Query, tagSet *model.TagSet, matchToNil bool) (matchedAssetsIndex, filteredAssetsIndex []int)

QueryIndex filter assets by queries and return matched asset indices. if asset is nil, it will be filtered.

func ReRegister added in v0.1.6

func ReRegister(assets []*model.Asset, idList []model.AssetID) error

ReRegister set ID to asset. This is destructive method.

func SplitBy

func SplitBy(assets []*model.Asset, f func(asset *model.Asset) bool) (trueAssets, falseAssets []*model.Asset)

func SplitByID

func SplitByID(assets []*model.Asset) (assetsWithID, assetsWithOutID []*model.Asset)

func SplitByPath

func SplitByPath(assets []*model.Asset) (assetsWithPath, assetsWithOutPath []*model.Asset)

func ToAssetIDList

func ToAssetIDList(assets []*model.Asset) (assetIDList []model.AssetID)

func ToAssets

func ToAssets(importAssets []*model.ImportAsset, tagSet *model.TagSet) (assets []*model.Asset, err error)

func ToPaths

func ToPaths(assets []*model.Asset) (paths []string)

func ToUniqTagNames

func ToUniqTagNames(assets []*model.ImportAsset) (tagNames []string)

func Update added in v0.1.6

func Update(baseAssets, otherAssets []*model.Asset) error

Update merge provided base assets and other assets.

Types

This section is empty.

Jump to

Keyboard shortcuts

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