files

package
v0.55.4 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidURL is returns when the URL of the remote file is not a URL
	// with an HTTPS scheme.
	ErrInvalidURL = errors.New("invalid url")
	// ErrUnsuccessfulRequest is returned when the
	ErrUnsuccessfulRequest = errors.New("unsuccessful request")
)
View Source
var ErrBadTargetFile = errors.New("target file should be a filename not a directory")

ErrBadTargetFile is returned when the target file is not a hint for a file but a directory.

Functions

func IsRemoteFile

func IsRemoteFile(path string) bool

Types

type Loader

type Loader interface {
	// Root returns the root location for this Loader.
	Path() string

	// Load returns the bytes read from the location or an error.
	Load(ctx context.Context) ([]byte, error)
}

Loader is an interface implemented by a struct that can resolve a path or a URI and return the contents as a byte slice.

func NewLoader

func NewLoader(configurationDir, pathOrURI, targetFile string) (Loader, error)

NewLoader takes as an argumet a directory containing some configuration, a path or a URI and the expected file name that we want to fetch. If the

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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