fetch

package
v0.0.0-...-e43970d Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAgentLocal = "<local>"
	AddrLocal      = "0.0.0.0:0"
)

Variables

This section is empty.

Functions

func InjectTo

func InjectTo(iso *v8go.Isolate, global *v8go.ObjectTemplate, opt ...Option) error

func UserAgent

func UserAgent() string

Types

type Fetcher

type Fetcher interface {
	GetLocalHandler() http.Handler

	GetFetchFunctionCallback() v8go.FunctionCallback
}

func NewFetcher

func NewFetcher(opt ...Option) Fetcher

type Option

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

func WithAddrLocal

func WithAddrLocal(addr string) Option

func WithLocalHandler

func WithLocalHandler(handler http.Handler) Option

func WithUserAgentProvider

func WithUserAgentProvider(provider UserAgentProvider) Option

type UserAgentProvider

type UserAgentProvider interface {
	GetUserAgent(u *url.URL) string
}

type UserAgentProviderFunc

type UserAgentProviderFunc func(u *url.URL) string

func (UserAgentProviderFunc) GetUserAgent

func (f UserAgentProviderFunc) GetUserAgent(u *url.URL) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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