Documentation
¶
Index ¶
- Variables
- func InsertFile(ctx context.Context, tx *sqlx.Tx, path string) error
- func RenameLabel(ctx context.Context, tx *sqlx.Tx, oldName string, newName string) error
- func UpsertLabel(ctx context.Context, tx *sqlx.Tx, name string, color string) error
- func WithDatabase(ctx context.Context, db *DB) context.Context
- type DB
- func (m *DB) AddFilesAndLinks(ctx context.Context, filepaths []string, labelNames []string) error
- func (m *DB) AddLabel(ctx context.Context, name string, color string) (*Label, error)
- func (m *DB) Close() error
- func (m *DB) DeleteFiles(ctx context.Context, paths []string) error
- func (m *DB) DeleteLabel(ctx context.Context, name string) error
- func (m *DB) GetAllLabels() ([]Label, error)
- func (m *DB) GetFileLabels(path string) ([]Label, error)
- func (m *DB) GetFiles(keywords []string) ([]File, error)
- func (m *DB) GetFilesByLabels(labels []string) ([]File, error)
- func (m *DB) GetFilesFiltered(pattern string, pathPrefix string) ([]File, error)
- func (m *DB) GetFilesFilteredWithLabels(labels []string, pattern string, pathPrefix string) ([]File, error)
- func (m *DB) GetSimilarLabel(name string) *Label
- func (m *DB) LabelExists(name string) bool
- func (m *DB) UpdateLabel(ctx context.Context, name string, newName string, newColor string) error
- type File
- type Label
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFileAlreadyExists = errors.New("file already exists in storage") ErrFilesNotFound = errors.New("couldn't find files") )
View Source
var ErrCouldNotDeleteFile = errors.New("could not delete file")
Functions ¶
func RenameLabel ¶
func UpsertLabel ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) AddFilesAndLinks ¶
func (*DB) GetAllLabels ¶
func (*DB) GetFilesFiltered ¶
func (*DB) GetFilesFilteredWithLabels ¶
func (*DB) GetSimilarLabel ¶
func (*DB) LabelExists ¶
Click to show internal directories.
Click to hide internal directories.