attachment

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAttachment

func CreateAttachment(c *gin.Context)

func GetAttachment

func GetAttachment(c *gin.Context)

func RemoveAttachment

func RemoveAttachment(c *gin.Context)

Types

type Attachment

type Attachment struct {
	Id       primitive.ObjectID
	Filename string
}

type AttachmentController

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

func NewAttachmentController

func NewAttachmentController(ar *AttachmentRepository) *AttachmentController

type AttachmentRepository

type AttachmentRepository struct {
	Client        *mongo.Client
	Configuration AttachmentRepositoryConfiguration
}

func NewAttachmentRepository

func NewAttachmentRepository(client *mongo.Client, configuration AttachmentRepositoryConfiguration) AttachmentRepository

func (*AttachmentRepository) Download

func (a *AttachmentRepository) Download(name string) ([]byte, error)

func (*AttachmentRepository) Remove

func (*AttachmentRepository) Upload

func (a *AttachmentRepository) Upload(data []byte, filename string) (primitive.ObjectID, error)

type AttachmentRepositoryConfiguration

type AttachmentRepositoryConfiguration struct {
	DatabaseName string
}

type IAttachmentController

type IAttachmentController interface {
	CreateAttachment(c *gin.Context)
	GetAttachment(c *gin.Context)
	RemoveAttachment(c *gin.Context)
}

type IAttachmentRepository

type IAttachmentRepository interface {
	Upload(data []byte, filename string) (primitive.ObjectID, error)
	Download(name string) ([]byte, error)
	Remove(id primitive.ObjectID) error
}

Jump to

Keyboard shortcuts

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