parser

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileNames

func GetFileNames(ctx context.Context, dirPath string) ([]string, error)

func ReadFile

func ReadFile(path string) ([]byte, error)

Types

type FileInfo

type FileInfo struct {
	Name          string
	Version       ver.Version
	Comment       string
	MigrationType MigrationType
}

func FilterMigrationFiles

func FilterMigrationFiles(
	fileInfos []*FileInfo, current, target ver.Version,
) []*FileInfo

FilterMigrationFiles returns sorted slice FileInfo and filtered by MigrationType

func ParseFileName

func ParseFileName(fileName string) (*FileInfo, error)

type MigrationType

type MigrationType int
const (
	Up MigrationType = iota
	Down
)

func (MigrationType) String

func (mt MigrationType) String() string

Jump to

Keyboard shortcuts

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