From 23034ec145662b9edcd98df3a570e968389e3fa8 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 19 Feb 2022 11:44:56 +0100 Subject: [feature] Stream files via reader (#404) * serve files via reader rather than byte slice * close readcloser when we're done with it * cast reader to readcloser --- internal/api/model/content.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal/api/model/content.go') diff --git a/internal/api/model/content.go b/internal/api/model/content.go index 754495738..2f38b2351 100644 --- a/internal/api/model/content.go +++ b/internal/api/model/content.go @@ -18,14 +18,16 @@ package model +import "io" + // Content wraps everything needed to serve a blob of content (some kind of media) through the API. type Content struct { // MIME content type ContentType string // ContentLength in bytes ContentLength int64 - // Actual content blob - Content []byte + // Actual content + Content io.Reader } // GetContentRequestForm describes a piece of content desired by the caller of the fileserver API. -- cgit v1.2.3