Documentation ¶
Overview ¶
Package render implements a simple wrapper around Webkit that primarily allows for the capture of screenshots.
This package will typically only compile on a modern Linux distribution and requires a running X server. A utility binary is also provided.
Index ¶
- Variables
- type Renderer
- type View
- func (v *View) Close()
- func (v *View) EvaluateJavaScript(ctx context.Context, script string) (result interface{}, err error)
- func (v *View) LoadHTML(content, baseURI string) error
- func (v *View) LoadURI(url string) error
- func (v *View) NewSnapshot(ctx context.Context) (result *image.RGBA, err error)
- func (v *View) TimeToFinish() (time.Duration, error)
- func (v *View) TimeToLoad() (time.Duration, error)
- func (v *View) TimeToStart() (time.Duration, error)
- func (v *View) Wait(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrLoadFailed signifies that Webkit reports failure of of the page load ErrLoadFailed = errors.New("load-failed") // ErrViewClosed signifies that the View has already been closed, not further operations allowed ErrViewClosed = errors.New("view-closed") // ErrNoImage signifies that snapshot did not return a usable image ErrNoImage = errors.New("no-image") // ErrNoTiming signifies that no timing information is available ErrNoTiming = errors.New("load-not-timed") // ErrNoX signifies that we did not find a usable X display server ErrNoX = errors.New("no-x-display") )
Functions ¶
This section is empty.
Types ¶
type Renderer ¶
func NewRenderer ¶
NewRenderer creates a new GTK based rendering context
Click to show internal directories.
Click to hide internal directories.