repositories

package
v0.0.0-...-66f1e8c Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileRepository

func NewFileRepository() domain.IFileRepository

func NewMongoAttachmentRepository

func NewMongoAttachmentRepository(client *mongo.Client, databaseName, collectionName string) domain.IAttachmentRepository

NewAttachmentRepository creates a new instance of AttachmentRepository.

Types

type AttachmentRepository

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

AttachmentRepository represents a repository interface for managing attachments.

func (*AttachmentRepository) Create

func (r *AttachmentRepository) Create(attachment domain.Attachment) error

Create creates a new attachment in the repository.

func (*AttachmentRepository) Delete

func (r *AttachmentRepository) Delete(systemID string, templateID string, ref string) error

Delete deletes an attachment from the repository.

func (*AttachmentRepository) Exist

func (r *AttachmentRepository) Exist(systemID string, templateID string, ref string) (bool, error)

ExistAsync checks if an attachment exists asynchronously.

func (*AttachmentRepository) Find

func (r *AttachmentRepository) Find(systemID string, templateID string, ref string) (*domain.Attachment, error)

Find retrieves an attachment from the repository.

func (*AttachmentRepository) Update

func (r *AttachmentRepository) Update(attachment *domain.Attachment) error

Update updates an existing attachment in the repository.

type FileRepository

type FileRepository struct {
}

func (*FileRepository) DeleteFiles

func (r *FileRepository) DeleteFiles(paths []string) error

func (*FileRepository) GetFiles

func (r *FileRepository) GetFiles(paths []string) ([]domain.File, error)

func (*FileRepository) Save

func (r *FileRepository) Save(file multipart.FileHeader) (string, error)

Jump to

Keyboard shortcuts

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