Documentation
¶
Index ¶
- func New(pool *pgxpool.Pool) port.FolderRepository
- type Repository
- func (r *Repository) Create(ctx context.Context, folder *entity.Folder) (string, error)
- func (r *Repository) Delete(ctx context.Context, id string) error
- func (r *Repository) ExistsByNameAndParent(ctx context.Context, workspaceID string, parentID *string, name string) (bool, error)
- func (r *Repository) ExistsByNameAndParentExcluding(ctx context.Context, workspaceID string, parentID *string, ...) (bool, error)
- func (r *Repository) FindByID(ctx context.Context, id string) (*entity.Folder, error)
- func (r *Repository) FindByIDWithCounts(ctx context.Context, id string) (*entity.FolderWithCounts, error)
- func (r *Repository) FindByParent(ctx context.Context, workspaceID string, parentID *string) ([]*entity.Folder, error)
- func (r *Repository) FindByWorkspace(ctx context.Context, workspaceID string) ([]*entity.Folder, error)
- func (r *Repository) FindByWorkspaceWithCounts(ctx context.Context, workspaceID string) ([]*entity.FolderWithCounts, error)
- func (r *Repository) FindRootFolders(ctx context.Context, workspaceID string) ([]*entity.Folder, error)
- func (r *Repository) HasChildren(ctx context.Context, id string) (bool, error)
- func (r *Repository) HasTemplates(ctx context.Context, id string) (bool, error)
- func (r *Repository) Update(ctx context.Context, folder *entity.Folder) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository implements the folder repository using PostgreSQL.
func (*Repository) Create ¶
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) 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 ¶
HasChildren checks if a folder has child folders.
func (*Repository) HasTemplates ¶
HasTemplates checks if a folder contains templates.