files

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATED   string = "CREATED"   // first chunk uploaded
	UPLOADED  string = "UPLOADED"  // all chunks uploaded
	PUBLISHED string = "PUBLISHED" // published - authorized for public download
	MOVED     string = "MOVED"     // available from S3/CDN
)

Variables

View Source
var ErrBadJSONResponse = errors.New("could not decode JSON response from files api")
View Source
var ErrFileNotRegistered = errors.New("file not registered")
View Source
var ErrInternalServerError = errors.New("internal server error")
View Source
var ErrNotAuthorised = errors.New("the request was not authorised - check token and user's permissions")
View Source
var ErrRequest = errors.New("an error occurred making a request to files api")
View Source
var ErrUnknown = errors.New("an unknown error occurred")

Functions

func GetContentLength added in v1.16.1

func GetContentLength(m *files.FileMetaData) string

func GetFilename added in v1.16.1

func GetFilename(m *files.FileMetaData) string

func Moved added in v1.18.0

func Moved(m *files.FileMetaData) bool

func Unpublished added in v1.16.1

func Unpublished(m *files.FileMetaData) bool

func UploadIncomplete added in v1.16.1

func UploadIncomplete(m *files.FileMetaData) bool

func Uploaded added in v1.16.1

func Uploaded(m *files.FileMetaData) bool

Types

type ContextKey

type ContextKey string

type FileDownloader

type FileDownloader func(path string) (io.ReadCloser, error)

func DownloadFile

func DownloadFile(s3client content.S3Client) FileDownloader

type HTTPClient

type HTTPClient interface {
	Do(ctx context.Context, req *http.Request) (*http.Response, error)
}

type MetadataFetcher

type MetadataFetcher func(ctx context.Context, path string) (files.FileMetaData, error)

func FetchMetadata

func FetchMetadata(filesClient downloads.FilesClient, authToken string) MetadataFetcher

Jump to

Keyboard shortcuts

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