fs

package
v0.2.22 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

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
}

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