Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SnapshotOption ¶
type SnapshotOption func(*SnapshotOptions)
func FormatSnapshotOption ¶
func FormatSnapshotOption(format string) SnapshotOption
func HeightSnapshotOption ¶
func HeightSnapshotOption(height int64) SnapshotOption
func MobileSnapshotOption ¶
func MobileSnapshotOption(b bool) SnapshotOption
func ScaleFactorSnapshotOption ¶
func ScaleFactorSnapshotOption(factor float64) SnapshotOption
func WidthSnapshotOption ¶
func WidthSnapshotOption(width int64) SnapshotOption
type SnapshotOptions ¶
type SnapshotOptions struct { Width int64 Height int64 Mobile bool Format string // mhtml, pdf, default mhtml. ScaleFactor float64 }
SnapshotOptions is the options used by Snapshot.
type Snapshoter ¶
type Snapshoter interface {
Snapshot(ctx context.Context, url string, options ...SnapshotOption) (io.Reader, error)
}
Snapshoter is a webpage snapshot interface.
func NewChromeRemoteSnapshoter ¶
func NewChromeRemoteSnapshoter(addr string) (Snapshoter, error)
NewChromeRemoteSnapshoter creates a Snapshoter backed by Chrome DevTools Protocol. The addr is the headless chrome websocket debugger endpoint, such as 127.0.0.1:9222.
Click to show internal directories.
Click to hide internal directories.