fileutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fileutil provides utilities for file operations

Index

Constants

View Source
const (
	// FileSource specifies to load config from a file
	FileSource = "file://"
	// EnvSource specifies to load config from an environment variable
	EnvSource = "env://"
)

Variables

View Source
var Vfs = afero.NewOsFs()

Vfs is virtual file system

Functions

func FileExists

func FileExists(file string) error

FileExists ensures that file exists

func FolderExists

func FolderExists(dir string) error

FolderExists ensures that folder exists

func LoadConfigWithSchema

func LoadConfigWithSchema(config string) (string, error)

LoadConfigWithSchema returns a configuration loaded from file:// or env:// If config does not start with file:// or env://, then the value is returned as is

func SaveConfigWithSchema

func SaveConfigWithSchema(path, value string) error

SaveConfigWithSchema saves configuration to file:// or env://

func SetMemMapFs added in v0.3.0

func SetMemMapFs()

SetMemMapFs changes Vfs to NewMemMapFs

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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