Help us shape the future of Go! Take the 2026 Go Developer Survey

streamer

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: BSD-3-Clause Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Parsers              []parser.PublicationParser // Parsers used to open a publication, in addition to the default parsers.
	IgnoreDefaultParsers bool                       // When true, only parsers provided in parsers will be used.
	InferA11yMetadata    InferA11yMetadata          // When not empty, additional accessibility metadata will be infered from the manifest.
	InferPageCount       bool                       // When true, will infer `metadata.numberOfPages` from the generated position list.
	InferIgnoredImages   manifest.HashList          // An optional list of hashes of images, to use in finding images that can be ignored when inferring accessibility metadata.
	ArchiveFactory       archive.ArchiveFactory     // Opens an archive (e.g. ZIP, RAR), optionally protected by credentials.
	HttpClient           *http.Client               // Service performing HTTP requests.
	OnCreatePublication  OnCreatePublicationFunc    // Called on every parsed [pub.Builder]. It can be used to modify the manifest, the root container or the list of service factories of a [pub.Publication]
	AddServiceLinks      bool                       // When true, services will add their links to the publication manifest. This can also be adjusted for individual services in `OnCreatePublication`
}

type InferA11yMetadata

type InferA11yMetadata uint8
const (
	// No accessibility metadata will be infered.
	InferA11yMetadataNo InferA11yMetadata = 0 + iota
	// Accessibility metadata will be infered from the manifest and merged in
	// the `Accessibility` object.
	InferA11yMetadataMerged
	// Accessibility metadata will be infered from the manifest and added
	// separately in the `InferredAccessibility` object.
	InferA11yMetadataSplit
)

type OnCreatePublicationFunc added in v0.10.2

type OnCreatePublicationFunc func(builder *pub.Builder) error

type Streamer

type Streamer struct {
	// contains filtered or unexported fields
}

Streamer opens a `Publication` using a list of parsers.

The `Streamer` is configured to use Readium's default parsers, which you can bypass using `Config.IgnoreDefaultParsers`. However, you can provide additional `Config.Parsers` which will take precedence over the default ones. This can also be used to provide an alternative configuration of a default parser.

func New

func New(config Config) Streamer

func (Streamer) Open

func (s Streamer) Open(ctx context.Context, a asset.PublicationAsset, credentials string) (*pub.Publication, error)

Parses a [Publication] from the given asset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL