web

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadToCache

func DownloadToCache(src string, opts ...RestyOpt) (string, error)

func DownloadToPath

func DownloadToPath(src, dest string, opts ...RestyOpt) (string, error)

func ExtractArchive

func ExtractArchive(src, dest string, opts ...RestyOpt) error

func GetFilenameForURL

func GetFilenameForURL(src string, opts ...RestyOpt) (string, error)

func HTTPGetLatestGitHubReleaseMatchingTag

func HTTPGetLatestGitHubReleaseMatchingTag(slug string, r *regexp.Regexp, opts ...RestyOpt) (string, error)

func HTTPGetLatestGitHubVersion

func HTTPGetLatestGitHubVersion(slug string, opts ...RestyOpt) (string, error)

func HTTPWriteFile

func HTTPWriteFile(rawURL, filename string, eTag *ETagItem, fileperm os.FileMode, opts ...RestyOpt) error

func RestyTrace

func RestyTrace(resp *resty.Response, err error)

func SanitizeArchivePath

func SanitizeArchivePath(dest, target string) (string, error)

SanitizeArchivePath archive file pathing from "G305: Zip Slip vulnerability".

func Uncompress

func Uncompress(src, dest string) error

func Untargz

func Untargz(src, dest string) error

func Unzip

func Unzip(src, dest string) error

Types

type ETag

type ETag []ETagItem

func ETagLoadConfig

func ETagLoadConfig() (ETag, error)

func (*ETag) Get

func (e *ETag) Get(key string) string

func (*ETag) GetItem

func (e *ETag) GetItem(key string) *ETagItem

func (*ETag) GetRelative

func (e *ETag) GetRelative(path string) string

func (*ETag) Save

func (e *ETag) Save() error

func (*ETag) Set

func (e *ETag) Set(key, value string)

type ETagItem

type ETagItem struct {
	Key   string `yaml:"name"`
	Value string `yaml:"value"`
	// contains filtered or unexported fields
}

func (*ETagItem) Save

func (e *ETagItem) Save() error

type RestyOpt

type RestyOpt func(*resty.Client)

func AddAuthToken

func AddAuthToken(token string) RestyOpt

func AddHeader

func AddHeader(key, value string) RestyOpt

Jump to

Keyboard shortcuts

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