Documentation ¶
Overview ¶
files defines a set of abstraction for 'files': an openable entities that could be read after.
This is not a file on a filesystem of your local machine, it also can include "in memory" files or even remote ones, like HTTP endpoints. If you make a GET request to HTTP endpoint, then a body is readable and you can consider it as an openable file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadHTTPClient = errors.New("incorrect http client")
ErrBadHTTPClient is returned if given HTTP client is initialized incorrectly.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File interface { // Open returns an readable entity for a file. It is important to not forget // to close it after the usage. Open(context.Context) (io.ReadCloser, error) // String returns a short text description for the file String() string }
File is an abstraction for a entity that can be opened in some context.
func NewHTTP ¶
NewHTTP returns a file abstraction for HTTP/HTTPS endpoint. You also need to provide a valid instance of http.Client to access it.
Click to show internal directories.
Click to hide internal directories.