browserbase

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserSettings

type BrowserSettings struct {
	BlockAds      bool `json:"blockAds,omitempty"`
	SolveCaptchas bool `json:"solveCaptchas,omitempty"`
	RecordSession bool `json:"recordSession,omitempty"`
	LogSession    bool `json:"logSession,omitempty"`
}

type Client

type Client struct {
	APIKey        string
	URL           string
	ConnectionURL string
	ProjectID     string
	Sessions      []*Session
	Options       *Options
}

func NewBrowserbaseClient

func NewBrowserbaseClient(apiKey string, projectID string, options *Options) *Client

func (*Client) CloseAllSessions

func (b *Client) CloseAllSessions(ctx context.Context) error

func (*Client) CloseSession

func (b *Client) CloseSession(ctx context.Context, sessionID string) error

func (*Client) ConnectionString

func (b *Client) ConnectionString(session Session) string

func (*Client) CreateSession

func (b *Client) CreateSession(ctx context.Context) (*Session, error)

type CloseSessionRequest

type CloseSessionRequest struct {
	ProjectID string `json:"projectId,omitempty"`
	Status    string `json:"status,omitempty"`
}

type CreateSessionRequest

type CreateSessionRequest struct {
	ProjectID       string          `json:"projectId,omitempty"`
	BrowserSettings BrowserSettings `json:"browserSettings,omitempty"`
	Proxies         []Proxy         `json:"proxies,omitempty"`
}

type Geolocation

type Geolocation struct {
	City    string `json:"city,omitempty"`
	State   string `json:"state,omitempty"`
	Country string `json:"country,omitempty"`
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithProxy

func WithProxy() Option

func WithProxyCountries

func WithProxyCountries(countries []string) Option

type Options

type Options struct {
	Proxy     bool
	Countries []string
}

func NewBrowserbaseOptions

func NewBrowserbaseOptions(ctx context.Context, opts ...Option) *Options

type Proxy

type Proxy struct {
	Type        string       `json:"type"`
	Geolocation *Geolocation `json:"geolocation,omitempty"`
}

type ProxyCountryOption

type ProxyCountryOption struct {
	Countries []string
}

type ProxyOption

type ProxyOption struct {
	Proxy bool
}

type Session

type Session struct {
	ID        string `json:"id,omitempty"`
	Status    string `json:"status,omitempty"`
	ContextID string `json:"contextId,omitempty"`
}

Jump to

Keyboard shortcuts

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