filesystem

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFSObject

func CheckFSObject(fsPath string) (bool, error)

func GetLatestVersionFromFiles

func GetLatestVersionFromFiles(migrationsDirs []string) (uint16, error)

func LoadObjectsFromFiles

func LoadObjectsFromFiles(config *conf.MigrationConfig) (
	map[enums.MigrationType][]*migrations.Migration, map[enums.HookType][]*migrations.Hook, []error)

LoadObjectsFromFiles reads migration and hook files from the specified directories.

This function processes files in the given directories to load migration and hook objects. It uses the provided configuration to determine which migrations and hooks should be included, avoiding unnecessary memory usage. If a file contains templates, they are replaced with actual content. For up migration files, an MD5 checksum is generated for the final content (after the templates process).

Notes:

  • Files are processed concurrently for better performance.
  • Mutexes ensure thread-safe updates to the migration and hook maps.
  • Only migrations and hooks matching the configuration criteria are loaded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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