migcom

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverMySQL    = "mysql"
	DriverMSSQL    = "mssql"
	DriverPostgres = "postgres"
	DriverSQLite   = "sqlite"
)

supported database driver names

View Source
const DefaultConfigFile = "./miglite.yaml"

DefaultConfigFile default config file.

View Source
const DefaultMigrationsDir = "./migrations"

DefaultMigrationsDir default migrations dirpath. can override by env: MIGRATIONS_PATH

Variables

View Source
var Log = &DefaultLogger{}

Log default Logger instance

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Code    string
	Message string
	Err     error
}

AppError represents an application-specific error

func NewError

func NewError(code, message string) *AppError

NewError creates a new AppError

func WrapError

func WrapError(err error, code, message string) *AppError

WrapError wraps an existing error with additional context

func (*AppError) Error

func (e *AppError) Error() string

Error returns the error message

func (*AppError) Unwrap

func (e *AppError) Unwrap() error

Unwrap returns the underlying error

type DefaultLogger

type DefaultLogger struct{}

DefaultLogger is a simple logger implementation

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(msg string, args ...any)

Debug logs a debug message

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(msg string, args ...any)

Error logs an error message

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(msg string, args ...any)

Info logs an info message

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn(msg string, args ...any)

Warn logs a warning message

type Logger

type Logger interface {
	Debug(msg string, args ...any)
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
}

Logger interface for logging

Jump to

Keyboard shortcuts

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