fs

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package fs provides file system operations for quadlet unit management

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContentHash

func GetContentHash(content string) []byte

GetContentHash calculates a SHA1 hash for content storage and change tracking.

Types

type Service added in v0.21.0

type Service struct {
	// contains filtered or unexported fields
}

Service provides file system operations with configurable paths.

func NewService added in v0.21.0

func NewService(configProvider config.Provider) *Service

NewService creates a new filesystem service with the given config provider.

func NewServiceWithLogger added in v0.21.0

func NewServiceWithLogger(configProvider config.Provider, logger log.Logger) *Service

NewServiceWithLogger creates a new filesystem service with explicit logger injection.

func (*Service) GetContentHash added in v0.21.0

func (s *Service) GetContentHash(content string) string

GetContentHash calculates a SHA1 hash for content storage and change tracking.

func (*Service) GetUnitFilePath added in v0.21.0

func (s *Service) GetUnitFilePath(name, unitType string) string

GetUnitFilePath returns the full path for a quadlet unit file.

func (*Service) GetUnitFilesDirectory added in v0.21.0

func (s *Service) GetUnitFilesDirectory() string

GetUnitFilesDirectory returns the directory where quadlet unit files are stored.

func (*Service) HasUnitChanged added in v0.21.0

func (s *Service) HasUnitChanged(unitPath, content string) bool

HasUnitChanged checks if the content of a unit file has changed.

func (*Service) WriteUnitFile added in v0.21.0

func (s *Service) WriteUnitFile(unitPath, content string) error

WriteUnitFile writes unit content to the specified file path.

Jump to

Keyboard shortcuts

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