repositories

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilesRepo

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

func (*FilesRepo) AddDownload

func (r *FilesRepo) AddDownload(ctx context.Context, id string) error

func (*FilesRepo) Create

func (r *FilesRepo) Create(ctx context.Context, f *models.File) error

func (*FilesRepo) Delete

func (r *FilesRepo) Delete(ctx context.Context, id string) error

func (*FilesRepo) Exists

func (r *FilesRepo) Exists(ctx context.Context, id string) (bool, error)

func (*FilesRepo) Get

func (r *FilesRepo) Get(ctx context.Context, id string) (*models.File, error)

type FoldersRepo

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

func (*FoldersRepo) Create

func (r *FoldersRepo) Create(ctx context.Context, f *models.Folder) error

func (*FoldersRepo) Delete

func (r *FoldersRepo) Delete(ctx context.Context, folderID string) error

func (*FoldersRepo) DeleteExpired

func (r *FoldersRepo) DeleteExpired(ctx context.Context) error

func (*FoldersRepo) Get

func (r *FoldersRepo) Get(ctx context.Context, id string) (*models.Folder, error)

func (*FoldersRepo) GetBySpace added in v1.1.4

func (r *FoldersRepo) GetBySpace(ctx context.Context, spaceID string, pagination *models.Pagination) ([]*models.Folder, error)

func (*FoldersRepo) Update

func (r *FoldersRepo) Update(ctx context.Context, f *models.Folder) error

type Repo

type Repo struct {
	Users   *UsersRepo
	Spaces  *SpacesRepo
	Folders *FoldersRepo
	Files   *FilesRepo
}

func New

func New(conn string) (*Repo, error)

type SpacesRepo

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

func (*SpacesRepo) Create

func (r *SpacesRepo) Create(ctx context.Context, s *models.Space) error

func (*SpacesRepo) Delete added in v1.1.1

func (r *SpacesRepo) Delete(ctx context.Context, spaceID string) error

func (*SpacesRepo) GetAll

func (r *SpacesRepo) GetAll(ctx context.Context) ([]*models.Space, error)

func (*SpacesRepo) GetAllByUsername

func (r *SpacesRepo) GetAllByUsername(ctx context.Context, username string) ([]*models.Space, error)

func (*SpacesRepo) GetByName

func (r *SpacesRepo) GetByName(ctx context.Context, name string) (*models.Space, error)

func (*SpacesRepo) Update

func (r *SpacesRepo) Update(ctx context.Context, s *models.Space) error

type UsersRepo

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

func (*UsersRepo) CreateOrUpdate

func (r *UsersRepo) CreateOrUpdate(ctx context.Context, u *models.User) error

TODO rewrite this when ent supports the Save method on Update; until then we have to do an extra select https://github.com/ent/ent/issues/2600

func (*UsersRepo) GetByRememberToken

func (r *UsersRepo) GetByRememberToken(ctx context.Context, token string) (*models.User, error)

func (*UsersRepo) RenewRememberToken

func (r *UsersRepo) RenewRememberToken(ctx context.Context, id string) error

Jump to

Keyboard shortcuts

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