diff options
| author | 2022-02-12 18:27:58 +0000 | |
|---|---|---|
| committer | 2022-02-12 18:27:58 +0000 | |
| commit | 31935ee206107f077878d3cdb6a26b82436b6893 (patch) | |
| tree | 2d522bf98013dc5a4539133561b645fd7457eb06 /internal/transport/transport.go | |
| parent | [chore] Add nightly mirror to Codeberg.org (#392) (diff) | |
| parent | Go mod tidy (diff) | |
| download | gotosocial-0.2.0.tar.xz | |
Merge pull request #361 from superseriousbusiness/media_refactorv0.2.0
Refactor media handler to allow async media resolution
Diffstat (limited to 'internal/transport/transport.go')
| -rw-r--r-- | internal/transport/transport.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/transport/transport.go b/internal/transport/transport.go index 73b015865..9e8cd8213 100644 --- a/internal/transport/transport.go +++ b/internal/transport/transport.go @@ -21,6 +21,7 @@ package transport import ( "context" "crypto" + "io" "net/url" "sync" @@ -33,8 +34,8 @@ import ( // functionality for fetching remote media. type Transport interface { pub.Transport - // DereferenceMedia fetches the bytes of the given media attachment IRI, with the expectedContentType. - DereferenceMedia(ctx context.Context, iri *url.URL, expectedContentType string) ([]byte, error) + // DereferenceMedia fetches the given media attachment IRI, returning the reader and filesize. + DereferenceMedia(ctx context.Context, iri *url.URL) (io.ReadCloser, int, error) // DereferenceInstance dereferences remote instance information, first by checking /api/v1/instance, and then by checking /.well-known/nodeinfo. DereferenceInstance(ctx context.Context, iri *url.URL) (*gtsmodel.Instance, error) // Finger performs a webfinger request with the given username and domain, and returns the bytes from the response body. |
