store

package
v0.0.0-...-95b795d Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(db *sqlx.DB) Client

func (*Client) AddTag

func (c *Client) AddTag(ctx context.Context, fileId string, tag string) error

func (*Client) CreateAccessKey

func (c *Client) CreateAccessKey(key *data.Access) error

func (*Client) CreateFile

func (c *Client) CreateFile(ctx context.Context, id string, path string, tags data.TagSet) error

func (*Client) DestroyCursor

func (c *Client) DestroyCursor(key CursorKey)

func (*Client) GetAccessKeys

func (c *Client) GetAccessKeys(ctx context.Context, file *data.File) ([]*data.Access, error)

func (*Client) GetFiles

func (c *Client) GetFiles(ctx context.Context, cursor CursorKey) ([]*data.File, error)

func (*Client) GetTags

func (c *Client) GetTags(ctx context.Context, fileId string) (data.TagSet, error)

func (Client) Migrate

func (c Client) Migrate() error

func (*Client) NewCursor

func (c *Client) NewCursor(pageSize int, orderBy string, order Order, fn CursorFunc) CursorKey

type Cursor

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

type CursorFunc

type CursorFunc func(ctx context.Context, tail string, db *sqlx.DB) (*sqlx.Rows, error)

func AllFiles

func AllFiles() CursorFunc

func FileNameSearch

func FileNameSearch(name string) CursorFunc

func FileTagSearch

func FileTagSearch(tag string) CursorFunc

type CursorKey

type CursorKey uuid.UUID

type Order

type Order string
const (
	Descend Order = "DESC"
	Ascend  Order = "ASC"
)

Jump to

Keyboard shortcuts

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