Documentation
¶
Index ¶
- func AuthenticatedRequest(address string, opts ...RequestOption) ([]byte, string, int, int, error)
- func AuthenticatedRequestDownload(address string, opts ...RequestOption) (string, string, int, int, error)
- func DownloadFTP(ctx context.Context, ustr string, secret tl.Secret, auth tl.FeedAuthorization) (io.ReadCloser, error)
- func DownloadHTTP(ctx context.Context, ustr string, secret tl.Secret, auth tl.FeedAuthorization) (io.ReadCloser, int, error)
- func DownloadS3(ctx context.Context, ustr string, secret tl.Secret, auth tl.FeedAuthorization) (io.ReadCloser, error)
- func UploadS3(ctx context.Context, ustr string, secret tl.Secret, uploadFile io.Reader) error
- func WithAllowFTP(req *Request)
- func WithAllowLocal(req *Request)
- func WithAllowS3(req *Request)
- func WithAuth(secret tl.Secret, auth tl.FeedAuthorization) func(req *Request)
- type Request
- type RequestOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticatedRequest ¶
AuthenticatedRequest fetches a url using a secret and auth description. Returns []byte, sha1, size, response code.
func AuthenticatedRequestDownload ¶
func AuthenticatedRequestDownload(address string, opts ...RequestOption) (string, string, int, int, error)
AuthenticatedRequestDownload fetches a url using a secret and auth description. Returns temp file path, sha1, size, response code. Caller is responsible for deleting the file.
func DownloadFTP ¶
func DownloadFTP(ctx context.Context, ustr string, secret tl.Secret, auth tl.FeedAuthorization) (io.ReadCloser, error)
func DownloadHTTP ¶
func DownloadS3 ¶
func DownloadS3(ctx context.Context, ustr string, secret tl.Secret, auth tl.FeedAuthorization) (io.ReadCloser, error)
func WithAllowFTP ¶
func WithAllowFTP(req *Request)
func WithAllowLocal ¶
func WithAllowLocal(req *Request)
func WithAllowS3 ¶
func WithAllowS3(req *Request)
Types ¶
type Request ¶
type Request struct {
URL string
AllowFTP bool
AllowS3 bool
AllowLocal bool
Secret tl.Secret
Auth tl.FeedAuthorization
}
func NewRequest ¶
func NewRequest(address string, opts ...RequestOption) *Request
type RequestOption ¶
type RequestOption func(*Request)
Click to show internal directories.
Click to hide internal directories.