screenshot

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateScreenShot

func CreateScreenShot(settings Settings) ([]byte, error)

CreateScreenShot is the entry point to create screenshot

Types

type Settings

type Settings struct {
	Url         string  // query url
	Width       int     // width of view port (default 1920)
	Height      int     // height of view port (default 1024)
	Scale       float64 // scale of final image (default 0.1, meaning that with default settings our image will be 192x102px)
	WaitForIdle bool    // wait for the page to be idle - wait for networkIdle event in Browser (default false)
	Wait        int     // ms to wait before rendering - only meaningful if WaitForIdle is false (default 10000, 10 seconds)
	Timeout     int     // ms to wait before returning timeout (default 60000, 60 seconds)
	Quality     int     // png quality
	Hash        string  // file hash for this setting to quickly find cached files
	MaxAge      int     // maximum age of cache file in seconds (!) before it gets reloaded (set to 0 to never renew files, default 2592000 = 30 days)
	Force       bool    // force update
}

struct to define screenshot settings

Jump to

Keyboard shortcuts

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