files

package
v0.0.0-...-b289748 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Files

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

func NewFiles

func NewFiles(fa FilesArgs) *Files

func (*Files) DeleteUnused

func (f *Files) DeleteUnused(olderThan time.Time, limit int) ([]string, error)

DeleteUnused deletes file upload records.

func (*Files) FinishUpload

func (f *Files) FinishUpload(fd *types.FileDef, success bool, size int64) (*types.FileDef, error)

FinishUpload marks file upload as completed, successfully or otherwise

func (*Files) Get

func (f *Files) Get(fid string) (*types.FileDef, error)

Get fetches a record of a specific file

func (*Files) LinkAttachments

func (f *Files) LinkAttachments(topic string, userId, msgId types.Uid, fids []string) error

LinkAttachments connects given topic or message to the file record IDs from the list.

func (*Files) StartUpload

func (f *Files) StartUpload(fd *types.FileDef) error

StartUpload initializes a file upload

type FilesArgs

type FilesArgs struct {
	DB     *pgxpool.Pool
	Utils  *utils.Utils
	Cfg    *config.StorePostgresConfig
	Shared *shared.Shared
	UGen   *types.UidGenerator
}

Jump to

Keyboard shortcuts

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