filesystem

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package filesystem contains the filesystem interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists added in v0.2.0

func Exists(path string) (bool, error)

Checks if a file exists at the given path using the filesystem interface.

func FileSystem

func FileSystem() afero.Fs

Get the filesystem interface from the viper configuration. If the filesystem interface is not set, the default filesystem interface is returned.

func SetFileSystem added in v0.2.0

func SetFileSystem(fs afero.Fs)

Set the filesystem interface in the viper configuration. This is useful for testing purposes.

func WriteFile added in v0.2.0

func WriteFile(path string, data []byte) error

Writes data to a file at the given path using the filesystem interface. If the file does not exist, it will be created, including all necessary directories. If the file exists, it will be overwritten.

Types

This section is empty.

Jump to

Keyboard shortcuts

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