core

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package core provides minimal utilities for CLI tools and code generation. This package has minimal dependencies and can be used without the full framework.

Package core provides minimal utilities for CLI tools and code generation.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the framework version (injected at build time via ldflags) Use: go build -ldflags "-X github.com/jimmitjoo/tjo/core.Version=x.y.z"

Functions

func CreateDirIfNotExists

func CreateDirIfNotExists(path string) error

CreateDirIfNotExists creates a directory if it doesn't exist

func CreateFileIfNotExists

func CreateFileIfNotExists(path string) error

CreateFileIfNotExists creates an empty file if it doesn't exist

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists

func MigrateDownAll

func MigrateDownAll(rootPath, dsn string) error

MigrateDownAll rolls back all migrations

func MigrateForce

func MigrateForce(rootPath, dsn string) error

MigrateForce forces the migration version without running migrations

func MigrateSteps

func MigrateSteps(steps int, rootPath, dsn string) error

MigrateSteps runs n migrations (positive = up, negative = down)

func MigrateUp

func MigrateUp(rootPath, dsn string) error

MigrateUp runs all pending migrations

func RandomString

func RandomString(n int) string

RandomString generates a cryptographically secure random string of the given length. Uses crypto/rand for secure randomness.

Types

type CLIConfig

type CLIConfig struct {
	RootPath string
	Version  string
	AppName  string
	DBType   string
	Config   *config.Config
}

CLIConfig holds the minimal configuration needed for CLI operations

func LoadCLIConfig

func LoadCLIConfig() (*CLIConfig, error)

LoadCLIConfig loads the configuration for CLI operations

Jump to

Keyboard shortcuts

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