From 63a588ba594052bc0370f176ef268fa4a64bf46d Mon Sep 17 00:00:00 2001 From: Daan Sprenkels Date: Wed, 22 Apr 2020 15:59:51 +0200 Subject: [PATCH] db: Add docstrings to FileUpload; NFC --- internal/db/fileupload.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/internal/db/fileupload.go b/internal/db/fileupload.go index f4ff68e..3f3829e 100644 --- a/internal/db/fileupload.go +++ b/internal/db/fileupload.go @@ -31,11 +31,23 @@ type FileUploadState int // FileUpload models an uploaded file. type FileUpload struct { - State FileUploadState - ID uuid.UUID - FileName string + // State of the FileUpload (present/deleted/etc). + State FileUploadState + + // ID identifies this FileUpload. + ID uuid.UUID + + // FileName contains the original filename of this FileUpload. + FileName string + + // Content type as determined by http.DetectContentType. ContentType string - Checksum uint32 + + // Checksum holds a crc32c checksum of the file. + // + // This checksum is only meant to allow for the detection of random + // database corruption. + Checksum uint32 } const (