files

package
v0.0.0-...-bc034c2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOwnerRequired = errors.New("owner required")
	ErrNameRequired  = errors.New("folder name is required")
	ErrTypeRequired  = errors.New("folder type is required")
	ErrPathRequired  = errors.New("folder path is required")
)

Functions

func Delete

func Delete(db *sql.DB, id int64) error

func Insert

func Insert(db *sql.DB, f *File) (id int64, err error)

func SetRoutes

func SetRoutes(r chi.Router, db *sql.DB, b *bucket.Bucket, q *queue.Queue)

func Update

func Update(db *sql.DB, id int64, f *File) error

Types

type File

type File struct {
	ID         int64     `json:"id"`
	FolderId   null.Int  `json:"-"`
	OwnerId    int64     `json:"owner_id"`
	Name       string    `json:"name"`
	Type       string    `json:"type"`
	Path       string    `json:"-"`
	CreatedAt  time.Time `json:"created_at"`
	ModifiedAt time.Time `json:"modified_at"`
	Deleted    bool      `json:"-"`
}

func Get

func Get(db *sql.DB, id int64) (*File, error)

func List

func List(db *sql.DB, folderId int64) ([]File, error)

func ListRoot

func ListRoot(db *sql.DB) ([]File, error)

func New

func New(ownerId int64, name, fileType, path string) (*File, error)

func (*File) Validate

func (f *File) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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