repository

package
v0.1.1 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: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset interface {
	Init(ws model.WSName) error
	Add(ws model.WSName, asset *model.Asset) (model.AssetID, error)
	BatchAdd(ws model.WSName, assets []*model.Asset) ([]model.AssetID, error)
	AddByFilePathIfDoesNotExist(ws model.WSName, filePath string) (id model.AssetID, added bool, err error)
	AddByFilePathListIfDoesNotExist(ws model.WSName, filePathList []string) (idList []model.AssetID, err error)
	Get(ws model.WSName, id model.AssetID) (asset *model.Asset, exist bool, err error)
	GetByPath(ws model.WSName, path string) (asset *model.Asset, exist bool, err error)
	Has(ws model.WSName, id model.AssetID) (ok bool, err error)
	Update(ws model.WSName, asset *model.Asset) error
	BatchUpdate(ws model.WSName, assets []*model.Asset) error
	Delete(ws model.WSName, id model.AssetID) error
	ListByAsync(ctx context.Context, ws model.WSName, f func(asset *model.Asset) bool, cap int) (assetChan <-chan *model.Asset, err error)
	ListRawByAsync(ctx context.Context, ws model.WSName, f func(v []byte) bool, cap int) (c <-chan []byte, err error)
	ListBy(ws model.WSName, f func(asset *model.Asset) bool) (assets []*model.Asset, err error)
	ForEach(ws model.WSName, f func(asset *model.Asset) error) error
	Revalidate(ws model.WSName) error
}

type Client

type Client struct {
	Asset     Asset
	Tag       Tag
	WorkSpace WorkSpace
	Meta      Meta
}

func NewClient

func NewClient(asset Asset, tag Tag, workspace WorkSpace, meta Meta) *Client

func (*Client) CreateWorkSpace

func (c *Client) CreateWorkSpace(ws model.WSName) (*model.WorkSpace, error)

func (*Client) Init

func (c *Client) Init() error

type Meta

type Meta interface {
	Init() error
	GetDBVersion() (*semver.Version, bool, error)
	SetDBVersion(version *semver.Version) error
}

type Tag

type Tag interface {
	Init(ws model.WSName) error
	Add(ws model.WSName, tagWithIndex *model.TagWithIndex) (model.TagID, error)
	AddByName(ws model.WSName, tagName string) (model.TagID, bool, error)
	AddByNames(ws model.WSName, tagNames []string) ([]model.TagID, error)
	Get(ws model.WSName, id model.TagID) (tagWithIndex *model.TagWithIndex, exist bool, err error)
	Update(ws model.WSName, tagWithIndex *model.TagWithIndex) error
	RecreateBucket(ws model.WSName) error
	ListAll(ws model.WSName) ([]*model.TagWithIndex, error)
	ListByAsync(ws model.WSName, f func(tagWithIndex *model.TagWithIndex) bool, cap int) (tagChan <-chan *model.TagWithIndex, err error)
	ListBy(ws model.WSName, f func(tagWithIndex *model.TagWithIndex) bool) (tags []*model.TagWithIndex, err error)
	ListAsSet(ws model.WSName) (set *model.TagSet, err error)
	ForEach(ws model.WSName, f func(tagWithIndex *model.TagWithIndex) error) error
}

type WorkSpace

type WorkSpace interface {
	Init() error
	List() (workspaces []*model.WorkSpace, err error)
	Add(ws *model.WorkSpace) error
	Update(ws *model.WorkSpace) error
}

Jump to

Keyboard shortcuts

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