cover

package
v0.0.0-...-dd4be11 Latest Latest
Warning

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

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

Documentation

Overview

Package cover manages folder cover photos and their associations.

Index

Constants

This section is empty.

Variables

View Source
var CoverPhotoCollectionKey = "coverPhoto"

CoverPhotoCollectionKey is the MongoDB collection name for cover photos.

Functions

func DeleteCoverByFolderID

func DeleteCoverByFolderID(ctx context.Context, folderID string) error

DeleteCoverByFolderID removes the cover photo for a folder.

func UpsertCoverByFolderID

func UpsertCoverByFolderID(ctx context.Context, folderID, coverPhotoID string) error

UpsertCoverByFolderID creates or updates the cover photo for a folder.

Types

type Photo

type Photo struct {
	FolderID     string `bson:"folderID"`
	CoverPhotoID string `bson:"coverPhotoID"`
}

Photo represents a folder's cover photo mapping.

func GetCoverByFolderID

func GetCoverByFolderID(ctx context.Context, folderID string) (*Photo, error)

GetCoverByFolderID retrieves the cover photo for a folder by its ID.

func GetCoversByFolderIDs

func GetCoversByFolderIDs(ctx context.Context, folderIDs ...string) ([]Photo, error)

GetCoversByFolderIDs retrieves cover photos for multiple folders in a single query. Folders without covers are silently omitted from the result.

func SetCoverPhoto

func SetCoverPhoto(ctx context.Context, folderID string, coverPhotoID string) (*Photo, error)

SetCoverPhoto sets or replaces the cover photo for a folder.

Jump to

Keyboard shortcuts

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