meta

package
v0.0.0-...-0707337 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortFieldName       = SortField("name")
	SortFieldCreateTime = SortField("createTime")
	SortFieldPageCount  = SortField("pageCount")

	SortOrderAscending  = SortOrder("ascending")
	SortOrderDescending = SortOrder("descending")
)

Variables

View Source
var ErrMetaDataNotFound = errors.New(2_000_000, "metadata for '%s' not found.")

Functions

func Count

func Count(ctx context.Context, client *ent.Client, u *ent.User, q QueryParams) (count int, err error)

func CreateQuery

func CreateQuery(ctx context.Context, client *ent.Client, u *ent.User, q QueryParams) (query *ent.MetaQuery, err error)

func GenerateImageIndices

func GenerateImageIndices(m *ent.Meta) error

func GenerateThumbnail

func GenerateThumbnail(m *ent.Meta, fileIndex int, details CropDetails) error

func IsItemExist

func IsItemExist(ctx context.Context, client *ent.Client, name string) bool

func NewItem

func NewItem(ctx context.Context, client *ent.Client, name string, ct meta.ContainerType) (i *ent.Meta, err error)

func Open

func Open(m *ent.Meta) (reader io.ReadCloser, err error)

func PopulateTags

func PopulateTags(ctx context.Context, client *ent.Client, m *ent.Meta) (out *ent.Meta, err error)

func Read

func Read(ctx context.Context, client *ent.Client, name string) (m *ent.Meta, err error)

func ReadAll

func ReadAll(ctx context.Context, client *ent.Client) (items []*ent.Meta, err error)

func ReadPage

func ReadPage(ctx context.Context, client *ent.Client, u *ent.User, q QueryParams) (items []*ent.Meta, err error)

func Write

func Write(ctx context.Context, client *ent.Client, m *ent.Meta) error

Types

type Container

type Container struct {
	Name string
	Type meta.ContainerType
}

func ListDir

func ListDir(path string) (files []Container, err error)

ListDir returns a list of content of a directory.

type CropDetails

type CropDetails struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

type QueryParams

type QueryParams struct {
	SearchName   string
	SearchTag    string
	SortBy       SortField
	SortOrder    SortOrder
	FavoriteOnly bool
	Page         int
	ItemPerPage  int
}

type SortField

type SortField string

type SortOrder

type SortOrder string

Jump to

Keyboard shortcuts

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