You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
435 B

package source
import (
"context"
"io"
"net/url"
)
// RemoteFile is abstraction for remote file.
type RemoteFile interface {
io.ReadCloser
// Name returns filename. Should not be empty.
Name() string
// Size returns size of file. If size is unknown, -1 should be returned.
Size() int64
}
// Source is abstraction for remote upload source.
type Source interface {
Open(ctx context.Context, u *url.URL) (RemoteFile, error)
}