fetch

package
v0.0.0-...-ff7c352 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	URL        string            `json:"url"`
	Method     string            `json:"method"`
	Body       []byte            `json:"body"`
	UserAgent  string            `json:"user_agent"`
	ReturnBody bool              `json:"return_body"`
	Extractors map[string]string `json:"extractors"`
}

Input the input used for fetching the requested data

type Output

type Output struct {
	StatusCode int                    `json:"status_code"`
	URL        string                 `json:"url"`
	Body       string                 `json:"body,omitempty"`
	Result     map[string]interface{} `json:"result"`
}

Output the fetch result

func Do

func Do(ctx context.Context, input Input) (*Output, error)

Do fetches the requested input simply

func (Output) String

func (o Output) String() string

Jump to

Keyboard shortcuts

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