internal

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDefaults

func ApplyDefaults[T any](defaults *T, supplied *T) *T

func FetchHash

func FetchHash(ctx context.Context, url string) (string, error)

FetchHash downloads the given URL and parses the first hash out of it, assuming it's formatted in line with the output of sha256sum. Hashes are assumed to be hexadecimal and an error will be returned if this is not the case.

func FetchHtmlAndFind

func FetchHtmlAndFind(ctx context.Context, url string, selector string) ([]string, error)

FetchHtmlAndFind downloads the HTML page at the given URL and runs the specified CSS selector over it to find nodes. The textual content of those nodes is returned.

func FetchJson

func FetchJson(ctx context.Context, url string, i interface{}) error

FetchJson requests the given url and then attempts to unmarshal the body as JSON into the provided struct.

func FetchYaml

func FetchYaml(ctx context.Context, url string, i interface{}) error

FetchYaml requests the given url and then attempts to unmarshal the body as YAML into the provided struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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