Documentation ¶
Index ¶
- func Download(storage string, key string) (io.ReadCloser, error)
- func UploadFile(storage string, src string, dst string) error
- func WithAllowFTP(req *Request)
- func WithAllowLocal(req *Request)
- func WithAllowS3(req *Request)
- func WithAuth(secret dmfr.Secret, auth dmfr.FeedAuthorization) func(req *Request)
- type Az
- func (r Az) CreateSignedUrl(ctx context.Context, key string, contentDisposition string, secret dmfr.Secret) (string, error)
- func (r Az) Download(ctx context.Context, key string, secret dmfr.Secret, ...) (io.ReadCloser, int, error)
- func (r Az) Upload(ctx context.Context, key string, secret dmfr.Secret, uploadFile io.Reader) error
- type Downloader
- type FetchResponse
- type Ftp
- type Http
- type Local
- type Presigner
- type Request
- type RequestOption
- type S3
- func (r S3) CreateSignedUrl(ctx context.Context, key string, contentDisposition string, secret dmfr.Secret) (string, error)
- func (r S3) Download(ctx context.Context, key string, secret dmfr.Secret, ...) (io.ReadCloser, int, error)
- func (r S3) Upload(ctx context.Context, key string, secret dmfr.Secret, uploadFile io.Reader) error
- type Store
- type Uploader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
func Download(storage string, key string) (io.ReadCloser, error)
Download is a convenience method for downloading a file from the store.
func UploadFile ¶
UploadFile is a convenience method for uploading a file to the store.
func WithAllowFTP ¶
func WithAllowFTP(req *Request)
func WithAllowLocal ¶
func WithAllowLocal(req *Request)
func WithAllowS3 ¶
func WithAllowS3(req *Request)
Types ¶
type Downloader ¶
type FetchResponse ¶
type FetchResponse struct { Filename string Data []byte ResponseSize int ResponseCode int ResponseSHA1 string FetchError error }
func AuthenticatedRequest ¶
func AuthenticatedRequest(address string, opts ...RequestOption) (FetchResponse, error)
AuthenticatedRequest fetches a url using a secret and auth description. Returns []byte, sha1, size, response code. Fatal errors will be returned as the error; non-fatal errors as FetchResponse.FetchError
func AuthenticatedRequestDownload ¶
func AuthenticatedRequestDownload(address string, opts ...RequestOption) (FetchResponse, error)
AuthenticatedRequestDownload is similar to AuthenticatedRequest but writes to a temporary file. Fatal errors will be returned as the error; non-fatal errors as FetchResponse.FetchError
type Request ¶
type Request struct { URL string AllowFTP bool AllowLocal bool AllowS3 bool MaxSize uint64 Secret dmfr.Secret Auth dmfr.FeedAuthorization }
func NewRequest ¶
func NewRequest(address string, opts ...RequestOption) *Request
type RequestOption ¶
type RequestOption func(*Request)
func WithMaxSize ¶
func WithMaxSize(s uint64) RequestOption
Click to show internal directories.
Click to hide internal directories.