model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetIDListToUint64List

func AssetIDListToUint64List(assetIDList []AssetID) (idList []uint64)

Types

type Asset

type Asset struct {
	ID            AssetID        `json:"id,omitempty"`
	Name          string         `json:"name"`
	Path          string         `json:"path"`
	BoundingBoxes []*BoundingBox `json:"boundingBoxes"`
}

func NewAssetFromFilePath

func NewAssetFromFilePath(filePath string) *Asset

func (*Asset) GetID

func (a *Asset) GetID() uint64

func (*Asset) HasAnyOneOfTagID

func (a *Asset) HasAnyOneOfTagID(tagSet *TagSet) bool

func (*Asset) HasTag

func (a *Asset) HasTag(tagID TagID) bool

func (*Asset) SetID

func (a *Asset) SetID(id uint64)

type AssetID

type AssetID uint64

type BoundingBox

type BoundingBox struct {
	ID     BoundingBoxID `json:"id"`
	TagID  TagID         `json:"tagID"`
	X      int           `json:"x"`
	Y      int           `json:"y"`
	Width  int           `json:"width"`
	Height int           `json:"height"`
}

func RemoveBoundingBoxByID

func RemoveBoundingBoxByID(boxes []*BoundingBox, replaceBoxID BoundingBoxID) (newBoxes []*BoundingBox)

func ReplaceBoundingBoxByID

func ReplaceBoundingBoxByID(boxes []*BoundingBox, replaceBox *BoundingBox) (newBoxes []*BoundingBox)

type BoundingBoxID

type BoundingBoxID uint64

type ImportAsset added in v0.1.1

type ImportAsset struct {
	*Asset        `mapstructure:",squash"`
	BoundingBoxes []*ImportBoundingBox `json:"boundingBoxes"`
}

func NewImportAssetFromFilePath added in v0.1.1

func NewImportAssetFromFilePath(filePath string) *ImportAsset

func (*ImportAsset) ToAsset added in v0.1.1

func (a *ImportAsset) ToAsset(tagSet *TagSet) (*Asset, error)

type ImportBoundingBox added in v0.1.1

type ImportBoundingBox struct {
	*BoundingBox
	TagName string
}

type Query

type Query struct {
	Op    QueryOP `json:"op"`
	Value string  `json:"value"`
}

func (*Query) Match

func (q *Query) Match(asset *Asset, tagSet *TagSet) bool

type QueryOP

type QueryOP string
const (
	EqualsQueryOP     QueryOP = "equals"
	NotEqualsQueryOP  QueryOP = "not-equals"
	StartWithQueryOP  QueryOP = "start-with"
	NoTagsQueryOP     QueryOP = "no-tags"
	PathEqualsQueryOP QueryOP = "path-equals"
)

type Tag

type Tag struct {
	ID   TagID  `json:"id"`
	Name string `json:"name"`
}

func (*Tag) GetID

func (t *Tag) GetID() uint64

func (*Tag) SetID

func (t *Tag) SetID(id uint64)

type TagID

type TagID uint64

type TagSet

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

func NewTagSet

func NewTagSet() *TagSet

func (*TagSet) Get

func (t *TagSet) Get(id TagID) (*Tag, bool)

func (*TagSet) GetByName

func (t *TagSet) GetByName(name string) (*Tag, bool)

func (*TagSet) Set

func (t *TagSet) Set(tag *Tag) bool

func (*TagSet) SubSetBy

func (t *TagSet) SubSetBy(f func(tag *Tag) bool) *TagSet

func (*TagSet) ToMap added in v0.1.1

func (t *TagSet) ToMap() (map[TagID]*Tag, map[string]*Tag)

type TagWithIndex

type TagWithIndex struct {
	*Tag
	Index int
}

type WSName

type WSName string

type WorkSpace

type WorkSpace struct {
	ID       WorkSpaceID `json:"id"`
	Name     WSName      `json:"name"`
	BasePath string      `json:"basePath"`
}

type WorkSpaceID

type WorkSpaceID uint64

Directories

Path Synopsis
old

Jump to

Keyboard shortcuts

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