fs

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigWriter

type ConfigWriter interface {
	WriteFile(name string, data []byte, perm os.FileMode) error
	MkdirAll(path string, perm os.FileMode) error
	// Returns whether or not anything was removed.
	RemoveIfExists(path string) (bool, error)

	Provider
}

FileSystem abstraction so we can use the same writing code for both local and ephemeral configuration repos.

type Provider

type Provider interface {
	GetFileContents(ctx context.Context, path string) ([]byte, error)
	GetDirContents(ctx context.Context, path string) ([]ProviderFile, error)
	IsNotExist(err error) bool
	GetFullPath(path string) string
}

FileSystem abstraction so we can use the same parsing code for both local and remote configuration repos.

type ProviderFile

type ProviderFile struct {
	Name  string
	Path  string
	IsDir bool
}

This file will contain both a filename and a filepath. The filepath will be relative to the provider, so it can be passed in to another call and be a valid file.

Jump to

Keyboard shortcuts

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