Documentation
¶
Overview ¶
Package source opens the documents docsight converts: local paths, file: and data: URIs, and, when allowed, http(s) URLs.
Index ¶
Constants ¶
const MaxFetch = 256 << 20
MaxFetch bounds how much a fetched document may be.
Variables ¶
var ErrFetchDisabled = errors.New("fetching URLs is disabled; start docsight with -allow-fetch to enable it")
ErrFetchDisabled is returned for an http(s) URL when fetching is off.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
convert.Input
// Key identifies this version of the document, for caching its
// conversion: a file's path, size and modification time, or a URL.
// It is empty when the document should not be cached.
Key string
// contains filtered or unexported fields
}
Document is an opened document, ready to convert.
type Options ¶
type Options struct {
// AllowFetch lets Open fetch http and https URLs. Off by default: a
// document server should not reach the network unless its user says so.
AllowFetch bool
// Client fetches URLs; nil uses a client with a one-minute timeout.
Client *http.Client
}
Options says what Open may reach.