Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStreamReader ¶
func NewStreamReader(ctx context.Context, handle cdprotoio.StreamHandle) io.ReadCloser
NewStreamReader creates a new stream reader.
Types ¶
type Instance ¶
type Instance interface { NewTab(logger log.Logger, conf config.Config) *Tab Name() string Close(logger log.Logger) }
Instance is the interface remote and local chrome must implement.
type LocalInstance ¶
type LocalInstance struct {
// contains filtered or unexported fields
}
LocalInstance is a locally running browser instance.
func NewLocalBrowserInstance ¶
func NewLocalBrowserInstance(ctx context.Context, logger log.Logger, insecureSkipVerify bool) (*LocalInstance, error)
NewLocalBrowserInstance creates a new local browser instance.
func (*LocalInstance) Close ¶
func (i *LocalInstance) Close(logger log.Logger)
func (*LocalInstance) Name ¶
func (i *LocalInstance) Name() string
Name returns the kind of browser instance.
type PDFOptions ¶
PDFOptions contains the templated HTML Body, Header and Footer strings.
type RemoteInstance ¶
type RemoteInstance struct {
// contains filtered or unexported fields
}
RemoteInstance is a remotely running browser instance.
func NewRemoteBrowserInstance ¶
func NewRemoteBrowserInstance(ctx context.Context, _ log.Logger, remoteChromeURL string) (*RemoteInstance, error)
NewRemoteBrowserInstance creates a new remote browser instance.
func (*RemoteInstance) Close ¶
func (i *RemoteInstance) Close(_ log.Logger)
Close releases the resources of browser instance.
func (*RemoteInstance) Name ¶
func (i *RemoteInstance) Name() string
Name returns the kind of browser instance.
type Tab ¶
type Tab struct {
// contains filtered or unexported fields
}
Tab is container for a browser tab.
func (*Tab) NavigateAndWaitFor ¶
NavigateAndWaitFor navigates to the given address and waits for the given event to be fired on the page.
func (*Tab) PrintToPDF ¶
func (t *Tab) PrintToPDF(options PDFOptions, writer io.Writer) error
PrintToPDF returns chroms tasks that print the requested HTML into a PDF and returns the PDF stream handle.