upload

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckQuarantineStatus

func CheckQuarantineStatus(ctx rcontext.RequestContext, hash string) error

func CheckSpamAsync

func CheckSpamAsync(ctx rcontext.RequestContext, reader io.Reader, metadata FileMetadata) chan SpamResponse

func FindRecord

func FindRecord(ctx rcontext.RequestContext, hash string, userId string, contentType string, fileName string) (*database.DbMedia, bool, error)

func GenerateMediaId

func GenerateMediaId(ctx rcontext.RequestContext, origin string) (string, error)

func LockForUpload

func LockForUpload(ctx rcontext.RequestContext, hash string) (func() error, error)

func PopulateCacheAsync

func PopulateCacheAsync(ctx rcontext.RequestContext, reader io.Reader, size int64, sha256hash string) chan struct{}

Types

type FileMetadata

type FileMetadata struct {
	Name        string
	ContentType string
	UserId      string
	Origin      string
	MediaId     string
}

type SpamResponse

type SpamResponse struct {
	Err    error
	IsSpam bool
}

Jump to

Keyboard shortcuts

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