Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned when the file could not be found on the provider. ErrNotFound = errors.New("not found") // ErrFilename is returned when the filename could not be parsed by the // provider. ErrFilename = errors.New("bad filename") // ErrBadGateway is returned when the upstream provider could not service the // request. ErrBadGateway = errors.New("bad gateway") )
Functions ¶
func NewGCSTransport ¶
func NewGCSTransport(ctx context.Context) (http.RoundTripper, error)
NewGCSTransport returns the transport used by GCS.
Types ¶
type Filesystem ¶
Filesystem provides a way to load files from the filesystem.
func (*Filesystem) Provide ¶
func (fp *Filesystem) Provide(ctx context.Context, filename string) (io.ReadCloser, error)
Provide provides a file via the virtual http.Dir filesystem.
type GCS ¶
type GCS struct {
// contains filtered or unexported fields
}
GCS provides a way to access files from Google Cloud Storage. Credentials used are loaded from the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
type Origin ¶
type Origin struct {
// contains filtered or unexported fields
}
Origin provides a way to access files from a url.
type Provider ¶
Provider describes a struct that provides the "Provide" method to provide an image from a filename.
type Proxy ¶ added in v1.3.7
type Proxy struct {
// contains filtered or unexported fields
}
Proxy provides a way to access files from a url.
func NewProxy ¶ added in v1.3.7
func NewProxy(transport http.RoundTripper) *Proxy
NewProxy returns a new Proxy Provider that will return files.
type S3 ¶
type S3 struct {
// contains filtered or unexported fields
}
S3 is a file provider that is capable of providing files from any S3 compatible service such as Minio or Amazon S3 itself.