fileops

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultManager

type DefaultManager struct {
}

DefaultManager implements the Manager interface

func (*DefaultManager) EnsureDir

func (m *DefaultManager) EnsureDir(path string) error

EnsureDir creates a directory if it doesn't exist

func (*DefaultManager) FileExists

func (m *DefaultManager) FileExists(path string) bool

FileExists checks if a file exists

func (*DefaultManager) ReadFile

func (m *DefaultManager) ReadFile(path string) ([]byte, error)

ReadFile reads content from a file

func (*DefaultManager) WriteFile

func (m *DefaultManager) WriteFile(path string, content []byte) error

WriteFile writes content to a file, creating directories as needed

func (*DefaultManager) WriteObjectAsYAML

func (m *DefaultManager) WriteObjectAsYAML(path string, object interface{}) error

WriteObjectAsYAML marshals an object to YAML and writes it to a file

type Manager

type Manager interface {
	EnsureDir(path string) error
	WriteFile(path string, content []byte) error
	ReadFile(path string) ([]byte, error)
	FileExists(path string) bool
	WriteObjectAsYAML(path string, object interface{}) error
}

Manager provides file operation functionality

func NewFileOpsManager

func NewFileOpsManager() Manager

NewFileOpsManager creates a new default file manager

Jump to

Keyboard shortcuts

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