folderrepo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(pool *pgxpool.Pool) port.FolderRepository

New creates a new folder repository.

Types

type Repository

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

Repository implements the folder repository using PostgreSQL.

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, folder *entity.Folder) (string, error)

Create creates a new folder. Note: The 'path' column is automatically computed by a database trigger.

func (*Repository) Delete

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

Delete deletes a folder.

func (*Repository) ExistsByNameAndParent

func (r *Repository) ExistsByNameAndParent(ctx context.Context, workspaceID string, parentID *string, name string) (bool, error)

ExistsByNameAndParent checks if a folder with the same name exists under the same parent.

func (*Repository) ExistsByNameAndParentExcluding

func (r *Repository) ExistsByNameAndParentExcluding(ctx context.Context, workspaceID string, parentID *string, name, excludeID string) (bool, error)

ExistsByNameAndParentExcluding checks excluding a specific folder ID.

func (*Repository) FindByID

func (r *Repository) FindByID(ctx context.Context, id string) (*entity.Folder, error)

FindByID finds a folder by ID.

func (*Repository) FindByIDWithCounts

func (r *Repository) FindByIDWithCounts(ctx context.Context, id string) (*entity.FolderWithCounts, error)

FindByIDWithCounts finds a folder by ID including item counts.

func (*Repository) FindByParent

func (r *Repository) FindByParent(ctx context.Context, workspaceID string, parentID *string) ([]*entity.Folder, error)

FindByParent lists all child folders of a parent folder.

func (*Repository) FindByWorkspace

func (r *Repository) FindByWorkspace(ctx context.Context, workspaceID string) ([]*entity.Folder, error)

FindByWorkspace lists all folders in a workspace.

func (*Repository) FindByWorkspaceWithCounts

func (r *Repository) FindByWorkspaceWithCounts(ctx context.Context, workspaceID string) ([]*entity.FolderWithCounts, error)

FindByWorkspaceWithCounts lists all folders in a workspace including item counts.

func (*Repository) FindRootFolders

func (r *Repository) FindRootFolders(ctx context.Context, workspaceID string) ([]*entity.Folder, error)

FindRootFolders lists all root folders in a workspace.

func (*Repository) HasChildren

func (r *Repository) HasChildren(ctx context.Context, id string) (bool, error)

HasChildren checks if a folder has child folders.

func (*Repository) HasTemplates

func (r *Repository) HasTemplates(ctx context.Context, id string) (bool, error)

HasTemplates checks if a folder contains templates.

func (*Repository) Update

func (r *Repository) Update(ctx context.Context, folder *entity.Folder) error

Update updates a folder. Note: The 'path' column is automatically maintained by a database trigger when parent_id changes.

Jump to

Keyboard shortcuts

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