Documentation
¶
Overview ¶
Package safelinks provides functionality for decoding Safe Links URLs to their original values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidURL indicates that an invalid URL was provided. ErrInvalidURL = errors.New("invalid URL provided") // ErrOriginalURLNotResolved indicates that we failed to resolve the // original URL using the given Safe Links URL. ErrOriginalURLNotResolved = errors.New("unable to resolve original URL") )
Functions ¶
func ProcessInputAsURL ¶
ProcessInputAsURL processes a given input string as a URL value. This input string represents a single URL given via CLI flag.
If an input string is not provided, this function will attempt to read input URLs from stdin. Each input URL is unescaped and quoting removed.
The collection of input URLs is returned or an error if one occurs.
func ProcessInputURLs ¶
ProcessInputURLs processes a given collection of input URL strings and emits successful decoding results to the specified results output sink. Errors are emitted to the specified error output sink if encountered but bulk processing continues until all input URLs have been evaluated.
If requested, decoded URLs are emitted in verbose format.
A boolean value is returned indicating whether any errors occurred.
func ReadURLFromUser ¶
ReadURLFromUser attempts to read a given URL pattern from the user via stdin prompt.
Types ¶
This section is empty.