network

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const BlankPageURL = "about:blank"

Variables

View Source
var NavigationEventType = core.NewType("ferret.drivers.cdp.network.NavigationEvent")

Functions

This section is empty.

Types

type Cookies added in v0.14.0

type Cookies map[string]*drivers.HTTPCookies

type Filter added in v0.14.0

type Filter struct {
	Patterns []drivers.ResourceFilter
}

type FrameLoadedListener

type FrameLoadedListener = func(ctx context.Context, frame page.Frame)

type Interceptor added in v0.16.0

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

func NewInterceptor added in v0.16.0

func NewInterceptor(logger zerolog.Logger, client *cdp.Client) *Interceptor

func (*Interceptor) AddFilter added in v0.16.0

func (i *Interceptor) AddFilter(name string, filter *Filter) error

func (*Interceptor) AddListener added in v0.16.0

func (i *Interceptor) AddListener(listener InterceptorListener) events.ListenerID

func (*Interceptor) IsRunning added in v0.16.0

func (i *Interceptor) IsRunning() bool

func (*Interceptor) RemoveFilter added in v0.16.0

func (i *Interceptor) RemoveFilter(name string)

func (*Interceptor) RemoveListener added in v0.16.0

func (i *Interceptor) RemoveListener(id events.ListenerID)

func (*Interceptor) Run added in v0.16.0

func (i *Interceptor) Run(ctx context.Context) error

type InterceptorFilter added in v0.16.0

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

func NewInterceptorFilter added in v0.16.0

func NewInterceptorFilter(filter *Filter) (*InterceptorFilter, error)

func (*InterceptorFilter) Filter added in v0.16.0

type InterceptorListener added in v0.16.0

type InterceptorListener func(ctx context.Context, msg *fetch.RequestPausedReply) bool

type Manager

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

func New

func New(
	logger zerolog.Logger,
	client *cdp.Client,
	options Options,
) (*Manager, error)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) DeleteCookies

func (m *Manager) DeleteCookies(ctx context.Context, url string, cookies *drivers.HTTPCookies) error

func (*Manager) GetCookies

func (m *Manager) GetCookies(ctx context.Context) (*drivers.HTTPCookies, error)

func (*Manager) GetHeaders

func (m *Manager) GetHeaders(_ context.Context) (*drivers.HTTPHeaders, error)

func (*Manager) GetResponse

func (m *Manager) GetResponse(_ context.Context, frameID page.FrameID) (drivers.HTTPResponse, error)

func (*Manager) Navigate

func (m *Manager) Navigate(ctx context.Context, url values.String) error

func (*Manager) NavigateBack

func (m *Manager) NavigateBack(ctx context.Context, skip values.Int) (values.Boolean, error)

func (*Manager) NavigateForward

func (m *Manager) NavigateForward(ctx context.Context, skip values.Int) (values.Boolean, error)

func (*Manager) OnNavigation added in v0.16.0

func (m *Manager) OnNavigation(ctx context.Context) (rtEvents.Stream, error)

func (*Manager) OnRequest added in v0.16.0

func (m *Manager) OnRequest(ctx context.Context) (rtEvents.Stream, error)

func (*Manager) OnResponse added in v0.16.0

func (m *Manager) OnResponse(ctx context.Context) (rtEvents.Stream, error)

func (*Manager) SetCookies

func (m *Manager) SetCookies(ctx context.Context, url string, cookies *drivers.HTTPCookies) error

func (*Manager) SetHeaders

func (m *Manager) SetHeaders(ctx context.Context, headers *drivers.HTTPHeaders) error

func (*Manager) WaitForNavigation

func (m *Manager) WaitForNavigation(ctx context.Context, opts WaitEventOptions) error
type NavigationEvent struct {
	URL      string
	FrameID  page.FrameID
	MimeType string
}
func (evt *NavigationEvent) Compare(other core.Value) int64
func (evt *NavigationEvent) Copy() core.Value
func (evt *NavigationEvent) GetIn(_ context.Context, path []core.Value) (core.Value, core.PathError)
func (evt *NavigationEvent) Hash() uint64
func (evt *NavigationEvent) MarshalJSON() ([]byte, error)
func (evt *NavigationEvent) String() string
func (evt *NavigationEvent) Type() core.Type
func (evt *NavigationEvent) Unwrap() interface{}
type NavigationEventStream struct {
	// contains filtered or unexported fields
}

type Options added in v0.14.0

type Options struct {
	Cookies Cookies
	Headers *drivers.HTTPHeaders
	Filter  *Filter
}

type ResourceFilter added in v0.16.0

type ResourceFilter struct {
	URL          glob.Glob
	ResourceType string
}

type WaitEventOptions added in v0.16.0

type WaitEventOptions struct {
	FrameID page.FrameID
	URL     *regexp.Regexp
}

Jump to

Keyboard shortcuts

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