netx

package
v0.29.5 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCannotCacheDownload          = errors.New("cannot cache download")
	ErrCannotCheckLocalCache        = errors.New("cannot check local cache")
	ErrCannotGetKeyFromURL          = errors.New("cannot get key from url")
	ErrCannotCopyCacheToDestination = errors.New("cannot copy cache to destination")
	ErrCannotClearCache             = errors.New("cannot clear cache")
	URLPrefixRegexp                 = regexp.MustCompile(`^[A-z0-9]+::`)
)
View Source
var ErrDownloadOptionsExhausted = errors.New("downloading options exhausted")

Functions

This section is empty.

Types

type Client

type Client interface {
	Download(src, dst string) error
	Clear() error
	ClearItem(src string) error
}

func WithLocalCache

func WithLocalCache(c Client, dir string) Client

type GoGetterClient

type GoGetterClient struct {
	// contains filtered or unexported fields
}

func NewGoGetterClient

func NewGoGetterClient() *GoGetterClient

func (*GoGetterClient) Clear

func (*GoGetterClient) Clear() error

func (*GoGetterClient) ClearItem

func (*GoGetterClient) ClearItem(_ string) error

func (*GoGetterClient) Download

func (g *GoGetterClient) Download(src, dst string) error

func (*GoGetterClient) URLHasForcedProtocol

func (g *GoGetterClient) URLHasForcedProtocol(url string) bool

URLHasForcedProtocol checks if the url has a forced protocol as described in hashicorp/go-getter.

type LocalCacheClientDecorator

type LocalCacheClientDecorator struct {
	// contains filtered or unexported fields
}

func (*LocalCacheClientDecorator) Clear

func (d *LocalCacheClientDecorator) Clear() error

func (*LocalCacheClientDecorator) ClearItem

func (d *LocalCacheClientDecorator) ClearItem(src string) error

func (*LocalCacheClientDecorator) Download

func (d *LocalCacheClientDecorator) Download(src, dst string) error

Jump to

Keyboard shortcuts

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