chromeserverclient

package
v0.0.0-...-e1bed08 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Function61 = "https://function61.com/api/chromeserver"
)

Variables

This section is empty.

Functions

func TokenFromEnv

func TokenFromEnv() (string, error)

Types

type AuthTokenObtainer

type AuthTokenObtainer func() (string, error)

func StaticToken

func StaticToken(token string) AuthTokenObtainer

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(baseUrl string, obtainAuthToken AuthTokenObtainer) (*Client, error)

func (*Client) Run

func (c *Client) Run(
	ctx context.Context,
	script string,
	data interface{},
	opts *Options,
) (*Output, error)

type Options

type Options struct {
	ErrorAutoScreenshot bool
	Params              map[string]string
}

type Output

type Output struct {
	LogMessages            []string         `json:"logMessages"`
	ErrorMessages          []string         `json:"errorMessages"`
	Error                  *string          `json:"error,omitempty"`
	ErrorAutoScreenshotUrl *string          `json:"errorAutoScreenshotUrl,omitempty"`
	Data                   *json.RawMessage `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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