Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependencies ¶
type Dependencies struct {
archive.ArchiveFactory
}
type FileAsset ¶
type FileAsset struct {
// contains filtered or unexported fields
}
Represents a publication stored as a file on the local file system.
func FileWithMediaType ¶
Creates a FileAsset from a File and an optional media type, when known.
func FileWithMediaTypeHint ¶
Creates a FileAsset from a File and an optional media type hint. Providing a media type hint will improve performances when sniffing the media type.
func (*FileAsset) CreateFetcher ¶
func (a *FileAsset) CreateFetcher(ctx context.Context, dependencies Dependencies, credentials string) (fetcher.Fetcher, error)
CreateFetcher implements PublicationAsset
type GCSAsset ¶ added in v0.9.0
type GCSAsset struct {
// contains filtered or unexported fields
}
Represents a publication stored on an Amazon S3-compatible remote server.
func GCSWithMediaType ¶ added in v0.9.0
func GCSWithMediaType(client *storage.Client, uri url.AbsoluteURL, mediatype *mediatype.MediaType) *GCSAsset
Creates a S3Asset from a File and an optional media type, when known.
func (*GCSAsset) CreateFetcher ¶ added in v0.9.0
func (a *GCSAsset) CreateFetcher(ctx context.Context, dependencies Dependencies, credentials string) (fetcher.Fetcher, error)
CreateFetcher implements PublicationAsset
type HTTPAsset ¶ added in v0.9.0
type HTTPAsset struct {
// contains filtered or unexported fields
}
Represents a publication stored on an Amazon S3-compatible remote server.
func HTTPWithMediaType ¶ added in v0.9.0
func HTTPWithMediaType(client *http.Client, url url.AbsoluteURL, mediatype *mediatype.MediaType) *HTTPAsset
Creates a HTTPAsset from a File and an optional media type, when known.
func (*HTTPAsset) CreateFetcher ¶ added in v0.9.0
func (a *HTTPAsset) CreateFetcher(ctx context.Context, dependencies Dependencies, credentials string) (fetcher.Fetcher, error)
CreateFetcher implements PublicationAsset
type PublicationAsset ¶
type PublicationAsset interface { Name() string // Name of the asset, e.g. a filename. MediaType(ctx context.Context) mediatype.MediaType // Media type of the asset. If unknown, fallback on `MediaType.Binary`. CreateFetcher(ctx context.Context, dependencies Dependencies, credentials string) (fetcher.Fetcher, error) // Creates a fetcher used to access the asset's content. }
Represents a digital medium (e.g. a file) offering access to a publication.
type S3Asset ¶ added in v0.9.0
type S3Asset struct {
// contains filtered or unexported fields
}
Represents a publication stored on an Amazon S3-compatible remote server.
func S3WithMediaType ¶ added in v0.9.0
func S3WithMediaType(client *s3.Client, uri url.AbsoluteURL, mediatype *mediatype.MediaType) *S3Asset
Creates a S3Asset from a File and an optional media type, when known.
func (*S3Asset) CreateFetcher ¶ added in v0.9.0
func (a *S3Asset) CreateFetcher(ctx context.Context, dependencies Dependencies, credentials string) (fetcher.Fetcher, error)
CreateFetcher implements PublicationAsset