cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeSuccess = iota
	ErrCodeGeneral
	ErrCodeInvalidCommand
	ErrCodeInvalidArgument
	ErrCodeInvalidFlag
	ErrCodeMissingArgument
	ErrCodeMissingFlag
	ErrCodeFileNotFound
	ErrCodePermissionDenied
	ErrCodeConfiguration
	ErrCodeDatabase
	ErrCodeNetwork
	ErrCodeTimeout
	ErrCodeValidation
	ErrCodeAuthentication
	ErrCodeAuthorization
	ErrCodeNotFound
	ErrCodeAlreadyExists
	ErrCodeInvalidOperation
	ErrCodeDependency
	ErrCodeInternal
)

Error codes

Variables

View Source
var (
	ErrInvalidCommand   = NewCLIError(ErrCodeInvalidCommand, "invalid command", nil)
	ErrInvalidArgument  = NewCLIError(ErrCodeInvalidArgument, "invalid argument", nil)
	ErrInvalidFlag      = NewCLIError(ErrCodeInvalidFlag, "invalid flag", nil)
	ErrMissingArgument  = NewCLIError(ErrCodeMissingArgument, "missing required argument", nil)
	ErrMissingFlag      = NewCLIError(ErrCodeMissingFlag, "missing required flag", nil)
	ErrFileNotFound     = NewCLIError(ErrCodeFileNotFound, "file not found", nil)
	ErrPermissionDenied = NewCLIError(ErrCodePermissionDenied, "permission denied", nil)
	ErrConfiguration    = NewCLIError(ErrCodeConfiguration, "configuration error", nil)
	ErrDatabase         = NewCLIError(ErrCodeDatabase, "database error", nil)
	ErrNetwork          = NewCLIError(ErrCodeNetwork, "network error", nil)
	ErrTimeout          = NewCLIError(ErrCodeTimeout, "operation timeout", nil)
	ErrValidation       = NewCLIError(ErrCodeValidation, "validation error", nil)
	ErrAuthentication   = NewCLIError(ErrCodeAuthentication, "authentication error", nil)
	ErrAuthorization    = NewCLIError(ErrCodeAuthorization, "authorization error", nil)
	ErrNotFound         = NewCLIError(ErrCodeNotFound, "resource not found", nil)
	ErrAlreadyExists    = NewCLIError(ErrCodeAlreadyExists, "resource already exists", nil)
	ErrInvalidOperation = NewCLIError(ErrCodeInvalidOperation, "invalid operation", nil)
	ErrDependency       = NewCLIError(ErrCodeDependency, "dependency error", nil)
	ErrInternal         = NewCLIError(ErrCodeInternal, "internal error", nil)
)

Error messages

View Source
var (
	// Required validator
	Required = func(field string) func(string) error {
		return func(value string) error {
			if strings.TrimSpace(value) == "" {
				return fmt.Errorf("%s is required", field)
			}
			return nil
		}
	}

	// Email validator
	Email = func(value string) error {
		if value == "" {
			return nil
		}

		if !strings.Contains(value, "@") || !strings.Contains(value, ".") {
			return fmt.Errorf("invalid email format")
		}
		return nil
	}

	// URL validator
	URL = func(value string) error {
		if value == "" {
			return nil
		}
		if !strings.HasPrefix(value, "http://") && !strings.HasPrefix(value, "https://") {
			return fmt.Errorf("URL must start with http:// or https://")
		}
		return nil
	}

	// MinLength validator
	MinLength = func(min int) func(string) error {
		return func(value string) error {
			if len(value) < min {
				return fmt.Errorf("must be at least %d characters long", min)
			}
			return nil
		}
	}

	// MaxLength validator
	MaxLength = func(max int) func(string) error {
		return func(value string) error {
			if len(value) > max {
				return fmt.Errorf("must be at most %d characters long", max)
			}
			return nil
		}
	}

	// MinMaxLength validator
	MinMaxLength = func(min, max int) func(string) error {
		return func(value string) error {
			if len(value) < min {
				return fmt.Errorf("must be at least %d characters long", min)
			}
			if len(value) > max {
				return fmt.Errorf("must be at most %d characters long", max)
			}
			return nil
		}
	}
)

Common validators

View Source
var (
	// String validations
	RequiredString = ValidationRule{Required: true}
	OptionalString = ValidationRule{Required: false}
	MinString      = func(min int) ValidationRule { return ValidationRule{Min: min} }
	MaxString      = func(max int) ValidationRule { return ValidationRule{Max: max} }
	MinMaxString   = func(min, max int) ValidationRule { return ValidationRule{Min: min, Max: max} }

	// Email validation
	EmailPattern = ValidationRule{
		Required: true,
		Pattern:  `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`,
	}

	// URL validation
	URLPattern = ValidationRule{
		Required: true,
		Pattern:  `^https?://[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}`,
	}

	// Numeric validations
	RequiredInt = ValidationRule{Required: true}
	OptionalInt = ValidationRule{Required: false}
	MinInt      = func(min int) ValidationRule { return ValidationRule{Min: min} }
	MaxInt      = func(max int) ValidationRule { return ValidationRule{Max: max} }
	MinMaxInt   = func(min, max int) ValidationRule { return ValidationRule{Min: min, Max: max} }

	// Boolean validations
	RequiredBool = ValidationRule{Required: true}
	OptionalBool = ValidationRule{Required: false}
)

Common validation rules

Functions

func Confirm

func Confirm(message string) bool

Confirm asks for user confirmation

func GetAllCommands

func GetAllCommands() []*cli.Command

GetAllCommands returns all registered commands (stub)

func GetEnvironment

func GetEnvironment() string

GetEnvironment returns the current environment

func GetProjectName

func GetProjectName() string

GetProjectName returns the project name from go.mod

func GetProjectRoot

func GetProjectRoot() string

GetProjectRoot returns the project root directory

func GraphQLCommands

func GraphQLCommands() []*cli.Command

GraphQLCommands returns GraphQL-related CLI commands

func IsDevelopment

func IsDevelopment() bool

IsDevelopment checks if the current environment is development

func IsProduction

func IsProduction() bool

IsProduction checks if the current environment is production

func IsStaging

func IsStaging() bool

IsStaging checks if the current environment is staging

func IsTesting

func IsTesting() bool

IsTesting checks if the current environment is testing

func PrintError

func PrintError(message string)

PrintError prints an error message

func PrintInfo

func PrintInfo(message string)

PrintInfo prints an info message

func PrintSuccess

func PrintSuccess(message string)

PrintSuccess prints a success message

func PrintTable

func PrintTable(headers []string, rows [][]string)

PrintTable prints a table

func PrintWarning

func PrintWarning(message string)

PrintWarning prints a warning message

func RegisterCommand

func RegisterCommand(cmd *cli.Command)

RegisterCommand registers a command (stub)

Types

type App

type App struct {
	*cli.App
	// contains filtered or unexported fields
}

App represents the CLI application

func NewApp

func NewApp() *App

NewApp creates a new CLI application

func (*App) Run

func (a *App) Run(arguments []string) error

Run runs the CLI application

func (*App) RunWithContext

func (a *App) RunWithContext(ctx *cli.Context, arguments []string) error

RunWithContext runs the CLI application with a context

type AuthCommands

type AuthCommands struct{}

AuthCommands contains all authentication-related commands

func NewAuthCommands

func NewAuthCommands() *AuthCommands

NewAuthCommands creates a new auth commands instance

func (*AuthCommands) AssignPermission

func (ac *AuthCommands) AssignPermission(ctx *cli.Context) error

AssignPermission assigns a permission to a role

func (*AuthCommands) AssignRole

func (ac *AuthCommands) AssignRole(ctx *cli.Context) error

AssignRole assigns a role to a user

func (*AuthCommands) CreateSuperUser

func (ac *AuthCommands) CreateSuperUser(ctx *cli.Context) error

CreateSuperUser creates a superuser account

func (*AuthCommands) ListPermissions

func (ac *AuthCommands) ListPermissions(ctx *cli.Context) error

ListPermissions lists all permissions

func (*AuthCommands) ListRoles

func (ac *AuthCommands) ListRoles(ctx *cli.Context) error

ListRoles lists all roles

func (*AuthCommands) ListUsers

func (ac *AuthCommands) ListUsers(ctx *cli.Context) error

ListUsers lists all users

func (*AuthCommands) MakeAuth

func (ac *AuthCommands) MakeAuth(ctx *cli.Context) error

MakeAuth scaffolds authentication system

func (*AuthCommands) MakePermission

func (ac *AuthCommands) MakePermission(ctx *cli.Context) error

MakePermission creates a new permission

func (*AuthCommands) MakeRole

func (ac *AuthCommands) MakeRole(ctx *cli.Context) error

MakeRole creates a new role

func (*AuthCommands) Register

func (ac *AuthCommands) Register()

Register registers all authentication commands

func (*AuthCommands) RevokePermission

func (ac *AuthCommands) RevokePermission(ctx *cli.Context) error

RevokePermission revokes a permission from a role

func (*AuthCommands) RevokeRole

func (ac *AuthCommands) RevokeRole(ctx *cli.Context) error

RevokeRole revokes a role from a user

type CLIError

type CLIError struct {
	Code    int
	Message string
	Err     error
}

CLIError represents a CLI-specific error

func NewCLIError

func NewCLIError(code int, message string, err error) *CLIError

NewCLIError creates a new CLI error

func (*CLIError) Error

func (e *CLIError) Error() string

Error implements the error interface

func (*CLIError) ExitCode

func (e *CLIError) ExitCode() int

ExitCode returns the exit code for this error

func (*CLIError) Unwrap

func (e *CLIError) Unwrap() error

Unwrap returns the underlying error

type CPUUsage

type CPUUsage struct {
	Usage       float64
	Cores       int
	LoadAverage float64
}

type CommandBuilder

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

CommandBuilder helps build commands

func NewCommand

func NewCommand(name, usage string) *CommandBuilder

NewCommand creates a new command with common options

func (*CommandBuilder) Action

func (cb *CommandBuilder) Action(action cli.ActionFunc) *CommandBuilder

Action sets the command action

func (*CommandBuilder) BoolFlag

func (cb *CommandBuilder) BoolFlag(name, usage string) *CommandBuilder

BoolFlag adds a bool flag

func (*CommandBuilder) Build

func (cb *CommandBuilder) Build() *cli.Command

Build builds the command

func (*CommandBuilder) Category

func (cb *CommandBuilder) Category(category string) *CommandBuilder

Category sets the command category

func (*CommandBuilder) Description

func (cb *CommandBuilder) Description(description string) *CommandBuilder

Description sets the command description

func (*CommandBuilder) Flag

func (cb *CommandBuilder) Flag(flag cli.Flag) *CommandBuilder

Flag adds a flag to the command

func (*CommandBuilder) IntFlag

func (cb *CommandBuilder) IntFlag(name string, value int, usage string) *CommandBuilder

IntFlag adds an int flag

func (*CommandBuilder) Register

func (cb *CommandBuilder) Register() *CommandBuilder

Register registers the command

func (*CommandBuilder) StringFlag

func (cb *CommandBuilder) StringFlag(name, value, usage string) *CommandBuilder

StringFlag adds a string flag

func (*CommandBuilder) StringSliceFlag

func (cb *CommandBuilder) StringSliceFlag(name, usage string) *CommandBuilder

StringSliceFlag adds a string slice flag

type CommandContext

type CommandContext struct {
	App  *cli.App
	Ctx  *cli.Context
	Args []string
}

CommandContext provides context and utilities for CLI commands

func NewCommandContext

func NewCommandContext(app *cli.App, ctx *cli.Context) *CommandContext

NewCommandContext creates a new command context

func (*CommandContext) Confirm

func (cc *CommandContext) Confirm(message string) bool

func (*CommandContext) CreateDirectory

func (cc *CommandContext) CreateDirectory(path string) error

func (*CommandContext) DirectoryExists

func (cc *CommandContext) DirectoryExists(path string) bool

func (*CommandContext) FileExists

func (cc *CommandContext) FileExists(path string) bool

func (*CommandContext) GetBoolFlag

func (cc *CommandContext) GetBoolFlag(name string) bool

func (*CommandContext) GetIntFlag

func (cc *CommandContext) GetIntFlag(name string) int

func (*CommandContext) GetStringArg

func (cc *CommandContext) GetStringArg(index int) string

func (*CommandContext) GetStringFlag

func (cc *CommandContext) GetStringFlag(name string) string

Helper methods for CommandContext

func (*CommandContext) PrintError

func (cc *CommandContext) PrintError(message string)

func (*CommandContext) PrintInfo

func (cc *CommandContext) PrintInfo(message string)

func (*CommandContext) PrintSuccess

func (cc *CommandContext) PrintSuccess(message string)

func (*CommandContext) PrintTable

func (cc *CommandContext) PrintTable(headers []string, rows [][]string)

func (*CommandContext) PrintWarning

func (cc *CommandContext) PrintWarning(message string)

func (*CommandContext) ReadFile

func (cc *CommandContext) ReadFile(path string) (string, error)

func (*CommandContext) WriteFile

func (cc *CommandContext) WriteFile(path string, content interface{}) error

type CommandRegistry

type CommandRegistry struct{}

CommandRegistry type (stub for compatibility)

type Config

type Config struct {
	Name        string
	Version     string
	Description string
	Usage       string
	Authors     []*cli.Author
	Flags       []cli.Flag
	Commands    []*cli.Command
}

Config holds CLI configuration

type DatabaseCommands

type DatabaseCommands struct{}

DatabaseCommands contains all database-related commands

func NewDatabaseCommands

func NewDatabaseCommands() *DatabaseCommands

NewDatabaseCommands creates a new database commands instance

func (*DatabaseCommands) DatabaseBackup

func (dc *DatabaseCommands) DatabaseBackup(ctx *cli.Context) error

DatabaseBackup creates a database backup

func (*DatabaseCommands) DatabaseRestore

func (dc *DatabaseCommands) DatabaseRestore(ctx *cli.Context) error

DatabaseRestore restores database from backup

func (*DatabaseCommands) DatabaseSeed

func (dc *DatabaseCommands) DatabaseSeed(ctx *cli.Context) error

DatabaseSeed runs database seeders

func (*DatabaseCommands) DatabaseTest

func (dc *DatabaseCommands) DatabaseTest(ctx *cli.Context) error

DatabaseTest tests database connection

func (*DatabaseCommands) DatabaseWipe

func (dc *DatabaseCommands) DatabaseWipe(ctx *cli.Context) error

DatabaseWipe wipes all database data

func (*DatabaseCommands) MakeMigration

func (dc *DatabaseCommands) MakeMigration(ctx *cli.Context) error

MakeMigration creates a new migration

func (*DatabaseCommands) MakeSeeder

func (dc *DatabaseCommands) MakeSeeder(ctx *cli.Context) error

MakeSeeder creates a new seeder

func (*DatabaseCommands) Migrate

func (dc *DatabaseCommands) Migrate(ctx *cli.Context) error

Migrate runs pending migrations

func (*DatabaseCommands) MigrateFresh

func (dc *DatabaseCommands) MigrateFresh(ctx *cli.Context) error

MigrateFresh drops all tables and re-runs migrations

func (*DatabaseCommands) MigrateRefresh

func (dc *DatabaseCommands) MigrateRefresh(ctx *cli.Context) error

MigrateRefresh refreshes migrations

func (*DatabaseCommands) MigrateReset

func (dc *DatabaseCommands) MigrateReset(ctx *cli.Context) error

MigrateReset rolls back all migrations

func (*DatabaseCommands) MigrateRollback

func (dc *DatabaseCommands) MigrateRollback(ctx *cli.Context) error

MigrateRollback rolls back the last migration

func (*DatabaseCommands) MigrateStatus

func (dc *DatabaseCommands) MigrateStatus(ctx *cli.Context) error

MigrateStatus shows migration status

func (*DatabaseCommands) Register

func (dc *DatabaseCommands) Register()

Register registers all database commands

type DatabaseValidator

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

DatabaseValidator provides database validation

func NewDatabaseValidator

func NewDatabaseValidator() *DatabaseValidator

NewDatabaseValidator creates a new database validator

func (*DatabaseValidator) ValidateConnectionString

func (dv *DatabaseValidator) ValidateConnectionString(driver, dsn string) error

ValidateConnectionString validates a database connection string

func (*DatabaseValidator) ValidateMigrationName

func (dv *DatabaseValidator) ValidateMigrationName(name string) error

ValidateMigrationName validates a migration name

type DevelopmentCommands

type DevelopmentCommands struct{}

DevelopmentCommands contains all development-related commands

func NewDevelopmentCommands

func NewDevelopmentCommands() *DevelopmentCommands

NewDevelopmentCommands creates a new development commands instance

func (*DevelopmentCommands) ConfigCache

func (dc *DevelopmentCommands) ConfigCache(ctx *cli.Context) error

ConfigCache caches configuration

func (*DevelopmentCommands) ConfigClear

func (dc *DevelopmentCommands) ConfigClear(ctx *cli.Context) error

ConfigClear clears configuration cache

func (*DevelopmentCommands) ConfigShow

func (dc *DevelopmentCommands) ConfigShow(ctx *cli.Context) error

ConfigShow shows configuration values

func (*DevelopmentCommands) EnvGet

func (dc *DevelopmentCommands) EnvGet(ctx *cli.Context) error

EnvGet gets an environment variable

func (*DevelopmentCommands) EnvSet

func (dc *DevelopmentCommands) EnvSet(ctx *cli.Context) error

EnvSet sets an environment variable

func (*DevelopmentCommands) Format

func (dc *DevelopmentCommands) Format(ctx *cli.Context) error

Format formats the code

func (*DevelopmentCommands) KeyGenerate

func (dc *DevelopmentCommands) KeyGenerate(ctx *cli.Context) error

KeyGenerate generates an application key

func (*DevelopmentCommands) Lint

func (dc *DevelopmentCommands) Lint(ctx *cli.Context) error

Lint runs the code linter

func (*DevelopmentCommands) ListRoutes

func (dc *DevelopmentCommands) ListRoutes(ctx *cli.Context) error

ListRoutes lists all registered routes

func (*DevelopmentCommands) QueueFailed

func (dc *DevelopmentCommands) QueueFailed(ctx *cli.Context) error

QueueFailed lists failed jobs

func (*DevelopmentCommands) QueueFlush

func (dc *DevelopmentCommands) QueueFlush(ctx *cli.Context) error

QueueFlush flushes all failed jobs

func (*DevelopmentCommands) QueueMonitor

func (dc *DevelopmentCommands) QueueMonitor(ctx *cli.Context) error

QueueMonitor monitors queue status

func (*DevelopmentCommands) QueueRetry

func (dc *DevelopmentCommands) QueueRetry(ctx *cli.Context) error

QueueRetry retries a failed job

func (*DevelopmentCommands) QueueRetryAll

func (dc *DevelopmentCommands) QueueRetryAll(ctx *cli.Context) error

QueueRetryAll retries all failed jobs

func (*DevelopmentCommands) QueueWork

func (dc *DevelopmentCommands) QueueWork(ctx *cli.Context) error

QueueWork starts the queue worker

func (*DevelopmentCommands) Register

func (dc *DevelopmentCommands) Register()

Register registers all development commands

func (*DevelopmentCommands) ScheduleList

func (dc *DevelopmentCommands) ScheduleList(ctx *cli.Context) error

ScheduleList lists scheduled tasks

func (*DevelopmentCommands) ScheduleRun

func (dc *DevelopmentCommands) ScheduleRun(ctx *cli.Context) error

ScheduleRun runs scheduled tasks

func (*DevelopmentCommands) Serve

func (dc *DevelopmentCommands) Serve(ctx *cli.Context) error

Serve starts the development server

func (dc *DevelopmentCommands) StorageLink(ctx *cli.Context) error

StorageLink creates a symbolic link for public storage

func (*DevelopmentCommands) Test

func (dc *DevelopmentCommands) Test(ctx *cli.Context) error

Test runs the test suite

func (*DevelopmentCommands) Tinker

func (dc *DevelopmentCommands) Tinker(ctx *cli.Context) error

Tinker starts an interactive shell

type DiskUsage

type DiskUsage struct {
	Total string
	Used  string
	Free  string
	Usage float64
}

type ErrorContext

type ErrorContext struct {
	Command   string
	Arguments []string
	Flags     map[string]interface{}
}

ErrorContext provides context for errors

func NewErrorContext

func NewErrorContext(command string, arguments []string, flags map[string]interface{}) *ErrorContext

NewErrorContext creates a new error context

func (*ErrorContext) AddErrorContext

func (ec *ErrorContext) AddErrorContext(err error) error

AddErrorContext adds context to an error

type ErrorFormatter

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

ErrorFormatter formats error messages

func NewErrorFormatter

func NewErrorFormatter(colors bool) *ErrorFormatter

NewErrorFormatter creates a new error formatter

func (*ErrorFormatter) FormatError

func (ef *ErrorFormatter) FormatError(err error) string

FormatError formats an error message

func (*ErrorFormatter) FormatInfo

func (ef *ErrorFormatter) FormatInfo(message string) string

FormatInfo formats an info message

func (*ErrorFormatter) FormatSuccess

func (ef *ErrorFormatter) FormatSuccess(message string) string

FormatSuccess formats a success message

func (*ErrorFormatter) FormatWarning

func (ef *ErrorFormatter) FormatWarning(message string) string

FormatWarning formats a warning message

type ErrorHandler

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

ErrorHandler handles CLI errors

func NewErrorHandler

func NewErrorHandler(verbose bool) *ErrorHandler

NewErrorHandler creates a new error handler

func (*ErrorHandler) Handle

func (eh *ErrorHandler) Handle(err error)

Handle handles an error

type ErrorLogger

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

ErrorLogger logs errors

func NewErrorLogger

func NewErrorLogger(verbose bool) *ErrorLogger

NewErrorLogger creates a new error logger

func (*ErrorLogger) LogError

func (el *ErrorLogger) LogError(err error)

LogError logs an error

func (*ErrorLogger) LogInfo

func (el *ErrorLogger) LogInfo(message string)

LogInfo logs an info message

func (*ErrorLogger) LogWarning

func (el *ErrorLogger) LogWarning(message string)

LogWarning logs a warning

type ErrorRecovery

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

ErrorRecovery provides error recovery functionality

func NewErrorRecovery

func NewErrorRecovery(verbose bool) *ErrorRecovery

NewErrorRecovery creates a new error recovery

func (*ErrorRecovery) HandleError

func (er *ErrorRecovery) HandleError(err error)

HandleError handles an error with recovery

func (*ErrorRecovery) Recover

func (er *ErrorRecovery) Recover()

Recover recovers from panics

type ErrorValidation

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

ErrorValidation provides validation error functionality

func NewErrorValidation

func NewErrorValidation() *ErrorValidation

NewErrorValidation creates a new validation error

func (*ErrorValidation) AddError

func (ev *ErrorValidation) AddError(field, message string)

AddError adds a validation error

func (*ErrorValidation) Error

func (ev *ErrorValidation) Error() string

Error returns the validation error message

func (*ErrorValidation) GetErrors

func (ev *ErrorValidation) GetErrors() map[string][]string

GetErrors gets all validation errors

func (*ErrorValidation) HasErrors

func (ev *ErrorValidation) HasErrors() bool

HasErrors checks if there are validation errors

func (*ErrorValidation) ToCLIError

func (ev *ErrorValidation) ToCLIError() *CLIError

ToCLIError converts validation errors to CLI error

type FailedJob

type FailedJob struct {
	ID       string
	Queue    string
	Job      string
	FailedAt string
	Error    string
}

type FileValidator

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

FileValidator provides file validation

func NewFileValidator

func NewFileValidator() *FileValidator

NewFileValidator creates a new file validator

func (*FileValidator) ValidateDirectory

func (fv *FileValidator) ValidateDirectory(path string) error

ValidateDirectory validates a directory path

func (*FileValidator) ValidateFile

func (fv *FileValidator) ValidateFile(path string) error

ValidateFile validates a file path

func (*FileValidator) ValidateFileExtension

func (fv *FileValidator) ValidateFileExtension(path string, allowedExtensions []string) error

ValidateFileExtension validates file extension

func (*FileValidator) ValidateFileSize

func (fv *FileValidator) ValidateFileSize(path string, maxSize int64) error

ValidateFileSize validates file size

type HealthStatus

type HealthStatus struct {
	Status     string
	Uptime     string
	Version    string
	Components map[string]string
}

type InputHelper

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

InputHelper provides helper functions for input

func NewInputHelper

func NewInputHelper() *InputHelper

NewInputHelper creates a new input helper

func (*InputHelper) ReadValidatedInt

func (ih *InputHelper) ReadValidatedInt(field, prompt string, validators ...func(int) error) (int, error)

ReadValidatedInt reads an integer with validation

func (*InputHelper) ReadValidatedIntWithDefault

func (ih *InputHelper) ReadValidatedIntWithDefault(field, prompt string, defaultValue int, validators ...func(int) error) (int, error)

ReadValidatedIntWithDefault reads an integer with validation and default

func (*InputHelper) ReadValidatedString

func (ih *InputHelper) ReadValidatedString(field, prompt string, validators ...func(string) error) (string, error)

ReadValidatedString reads a string with validation

func (*InputHelper) ReadValidatedStringWithDefault

func (ih *InputHelper) ReadValidatedStringWithDefault(field, prompt, defaultValue string, validators ...func(string) error) (string, error)

ReadValidatedStringWithDefault reads a string with validation and default

type InputProvider

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

InputProvider provides input functionality for CLI commands

func NewInputProvider

func NewInputProvider() *InputProvider

NewInputProvider creates a new input provider

func (*InputProvider) Confirm

func (ip *InputProvider) Confirm(message string) (bool, error)

Confirm asks for confirmation

func (*InputProvider) ConfirmWithDefault

func (ip *InputProvider) ConfirmWithDefault(message string, defaultValue bool) (bool, error)

ConfirmWithDefault asks for confirmation with a default value

func (*InputProvider) ReadBool

func (ip *InputProvider) ReadBool(prompt string) (bool, error)

ReadBool reads a boolean from input

func (*InputProvider) ReadBoolWithDefault

func (ip *InputProvider) ReadBoolWithDefault(prompt string, defaultValue bool) (bool, error)

ReadBoolWithDefault reads a boolean with a default value

func (*InputProvider) ReadChoice

func (ip *InputProvider) ReadChoice(prompt string, choices []string) (string, error)

ReadChoice reads a choice from a list of options

func (*InputProvider) ReadChoiceWithDefault

func (ip *InputProvider) ReadChoiceWithDefault(prompt string, choices []string, defaultValue string) (string, error)

ReadChoiceWithDefault reads a choice with a default value

func (*InputProvider) ReadInt

func (ip *InputProvider) ReadInt(prompt string) (int, error)

ReadInt reads an integer from input

func (*InputProvider) ReadIntWithDefault

func (ip *InputProvider) ReadIntWithDefault(prompt string, defaultValue int) (int, error)

ReadIntWithDefault reads an integer with a default value

func (*InputProvider) ReadMultiLine

func (ip *InputProvider) ReadMultiLine(prompt string, terminator string) (string, error)

ReadMultiLine reads multiple lines from input

func (*InputProvider) ReadPassword

func (ip *InputProvider) ReadPassword(prompt string) (string, error)

ReadPassword reads a password from input (hidden)

func (*InputProvider) ReadString

func (ip *InputProvider) ReadString(prompt string) (string, error)

ReadString reads a string from input

func (*InputProvider) ReadStringWithDefault

func (ip *InputProvider) ReadStringWithDefault(prompt, defaultValue string) (string, error)

ReadStringWithDefault reads a string with a default value

type InputValidator

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

InputValidator validates input

func NewInputValidator

func NewInputValidator() *InputValidator

NewInputValidator creates a new input validator

func (*InputValidator) AddValidator

func (iv *InputValidator) AddValidator(field string, validator func(string) error)

AddValidator adds a validator for a field

func (*InputValidator) Validate

func (iv *InputValidator) Validate(field, value string) error

Validate validates input

type LogLevel

type LogLevel int

LogLevel represents the log level

const (
	LogLevelDebug LogLevel = iota
	LogLevelInfo
	LogLevelWarning
	LogLevelError
	LogLevelFatal
)

func (LogLevel) Color

func (ll LogLevel) Color() string

Color returns the color code for the log level

func (LogLevel) String

func (ll LogLevel) String() string

String returns the string representation of the log level

type Logger

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

Logger provides logging functionality for CLI commands

func NewLogger

func NewLogger() *Logger

NewLogger creates a new logger

func (*Logger) Close

func (l *Logger) Close() error

Close closes the logger

func (*Logger) Debug

func (l *Logger) Debug(message string)

Debug logs a debug message

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...interface{})

Debugf logs a formatted debug message

func (*Logger) Error

func (l *Logger) Error(message string)

Error logs an error message

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

Errorf logs a formatted error message

func (*Logger) Fatal

func (l *Logger) Fatal(message string)

Fatal logs a fatal message and exits

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...interface{})

Fatalf logs a formatted fatal message and exits

func (*Logger) Info

func (l *Logger) Info(message string)

Info logs an info message

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

Infof logs a formatted info message

func (*Logger) SetColors

func (l *Logger) SetColors(colors bool)

SetColors enables or disables colors

func (*Logger) SetLevel

func (l *Logger) SetLevel(level LogLevel)

SetLevel sets the log level

func (*Logger) SetLogFile

func (l *Logger) SetLogFile(logFile string) error

SetLogFile sets the log file

func (*Logger) SetVerbose

func (l *Logger) SetVerbose(verbose bool)

SetVerbose enables or disables verbose output

func (*Logger) SetWriter

func (l *Logger) SetWriter(writer io.Writer)

SetWriter sets the output writer

func (*Logger) Warning

func (l *Logger) Warning(message string)

Warning logs a warning message

func (*Logger) Warningf

func (l *Logger) Warningf(format string, args ...interface{})

Warningf logs a formatted warning message

type MemoryUsage

type MemoryUsage struct {
	Total string
	Used  string
	Free  string
	Usage float64
}

type Metrics

type Metrics struct {
	HTTPRequests      int
	ActiveConnections int
	DatabaseQueries   int
	CacheHits         int
	CacheMisses       int
	QueueJobs         int
	FailedJobs        int
}

type MigrateCommand

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

MigrateCommand handles migration commands

func NewMigrateCommand

func NewMigrateCommand(manager *connection.Manager) *MigrateCommand

NewMigrateCommand creates a new migrate command

func (*MigrateCommand) Run

func (mc *MigrateCommand) Run(args []string) error

Run runs the migrate command

type MigrationFile

type MigrationFile struct {
	Name string
	Path string
	SQL  string
}

type ModelGenerator

type ModelGenerator struct {
	ModelName string
}

ModelGenerator handles model creation

func NewModelGenerator

func NewModelGenerator(modelName string) *ModelGenerator

NewModelGenerator creates a new model generator

func (*ModelGenerator) Generate

func (mg *ModelGenerator) Generate() error

Generate creates a new model

type ModuleFlags

type ModuleFlags struct {
	Full    bool // Generate full CRUD (web + API)
	APIOnly bool // Generate API routes only
	WebOnly bool // Generate web routes only
}

ModuleFlags represents the flags for module generation

type MonitoringCommands

type MonitoringCommands struct{}

MonitoringCommands contains all monitoring-related commands

func NewMonitoringCommands

func NewMonitoringCommands() *MonitoringCommands

NewMonitoringCommands creates a new monitoring commands instance

func (*MonitoringCommands) MonitorCPU

func (mc *MonitoringCommands) MonitorCPU(ctx *cli.Context) error

MonitorCPU shows CPU usage

func (*MonitoringCommands) MonitorDisk

func (mc *MonitoringCommands) MonitorDisk(ctx *cli.Context) error

MonitorDisk shows disk usage

func (*MonitoringCommands) MonitorHealth

func (mc *MonitoringCommands) MonitorHealth(ctx *cli.Context) error

MonitorHealth checks application health

func (*MonitoringCommands) MonitorLogs

func (mc *MonitoringCommands) MonitorLogs(ctx *cli.Context) error

MonitorLogs shows application logs

func (*MonitoringCommands) MonitorMemory

func (mc *MonitoringCommands) MonitorMemory(ctx *cli.Context) error

MonitorMemory shows memory usage

func (*MonitoringCommands) MonitorMetrics

func (mc *MonitoringCommands) MonitorMetrics(ctx *cli.Context) error

MonitorMetrics shows application metrics

func (*MonitoringCommands) MonitorNetwork

func (mc *MonitoringCommands) MonitorNetwork(ctx *cli.Context) error

MonitorNetwork shows network statistics

func (*MonitoringCommands) MonitorPerformance

func (mc *MonitoringCommands) MonitorPerformance(ctx *cli.Context) error

MonitorPerformance shows performance metrics

func (*MonitoringCommands) Register

func (mc *MonitoringCommands) Register()

Register registers all monitoring commands

type NetworkStats

type NetworkStats struct {
	BytesIn     string
	BytesOut    string
	PacketsIn   int
	PacketsOut  int
	Connections int
}

type OutputFormatter

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

OutputFormatter formats output

func NewOutputFormatter

func NewOutputFormatter() *OutputFormatter

NewOutputFormatter creates a new output formatter

func (*OutputFormatter) FormatCommandOutput

func (of *OutputFormatter) FormatCommandOutput(command string, output string) string

FormatCommandOutput formats command output

func (*OutputFormatter) FormatErrorOutput

func (of *OutputFormatter) FormatErrorOutput(error string) string

FormatErrorOutput formats error output

func (*OutputFormatter) FormatSuccessOutput

func (of *OutputFormatter) FormatSuccessOutput(message string) string

FormatSuccessOutput formats success output

type OutputLogger

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

OutputLogger logs output

func NewOutputLogger

func NewOutputLogger(logFile string) *OutputLogger

NewOutputLogger creates a new output logger

func (*OutputLogger) Log

func (ol *OutputLogger) Log(level, message string)

Log logs a message

func (*OutputLogger) LogDebug

func (ol *OutputLogger) LogDebug(message string)

LogDebug logs a debug message

func (*OutputLogger) LogError

func (ol *OutputLogger) LogError(message string)

LogError logs an error message

func (*OutputLogger) LogInfo

func (ol *OutputLogger) LogInfo(message string)

LogInfo logs an info message

func (*OutputLogger) LogSuccess

func (ol *OutputLogger) LogSuccess(message string)

LogSuccess logs a success message

func (*OutputLogger) LogWarning

func (ol *OutputLogger) LogWarning(message string)

LogWarning logs a warning message

type OutputManager

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

OutputManager manages output

func NewOutputManager

func NewOutputManager() *OutputManager

NewOutputManager creates a new output manager

func (*OutputManager) Clear

func (om *OutputManager) Clear()

Clear clears the screen

func (*OutputManager) Code

func (om *OutputManager) Code(code string, language string)

Code prints code

func (*OutputManager) Debug

func (om *OutputManager) Debug(message string)

Debug prints a debug message

func (*OutputManager) Error

func (om *OutputManager) Error(message string)

Error prints an error message

func (*OutputManager) Info

func (om *OutputManager) Info(message string)

Info prints an info message

func (*OutputManager) List

func (om *OutputManager) List(items []string)

List prints a list

func (*OutputManager) Newline

func (om *OutputManager) Newline()

Newline prints a newline

func (*OutputManager) NumberedList

func (om *OutputManager) NumberedList(items []string)

NumberedList prints a numbered list

func (*OutputManager) Print

func (om *OutputManager) Print(message string)

Print prints a message

func (*OutputManager) Printf

func (om *OutputManager) Printf(format string, args ...interface{})

Printf prints a formatted message

func (*OutputManager) Println

func (om *OutputManager) Println(message string)

Println prints a message with newline

func (*OutputManager) Progress

func (om *OutputManager) Progress(current, total int, message string)

Progress prints a progress bar

func (*OutputManager) Quote

func (om *OutputManager) Quote(quote string, author string)

Quote prints a quote

func (*OutputManager) Section

func (om *OutputManager) Section(title string)

Section prints a section header

func (*OutputManager) Separator

func (om *OutputManager) Separator()

Separator prints a separator

func (*OutputManager) SetColors

func (om *OutputManager) SetColors(colors bool)

SetColors sets color mode

func (*OutputManager) SetLogFile

func (om *OutputManager) SetLogFile(logFile string)

SetLogFile sets the log file

func (*OutputManager) SetVerbose

func (om *OutputManager) SetVerbose(verbose bool)

SetVerbose sets verbose mode

func (*OutputManager) Spinner

func (om *OutputManager) Spinner(message string)

Spinner prints a spinner

func (*OutputManager) Subsection

func (om *OutputManager) Subsection(title string)

Subsection prints a subsection header

func (*OutputManager) Success

func (om *OutputManager) Success(message string)

Success prints a success message

func (*OutputManager) Table

func (om *OutputManager) Table(headers []string, rows [][]string)

Table prints a table

func (*OutputManager) Warning

func (om *OutputManager) Warning(message string)

Warning prints a warning message

type OutputProvider

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

OutputProvider provides output functionality for CLI commands

func NewOutputProvider

func NewOutputProvider() *OutputProvider

NewOutputProvider creates a new output provider

func (*OutputProvider) Clear

func (op *OutputProvider) Clear()

Clear clears the screen

func (*OutputProvider) Code

func (op *OutputProvider) Code(code string, language string)

Code prints code with syntax highlighting

func (*OutputProvider) Debug

func (op *OutputProvider) Debug(message string)

Debug prints a debug message

func (*OutputProvider) Error

func (op *OutputProvider) Error(message string)

Error prints an error message

func (*OutputProvider) Info

func (op *OutputProvider) Info(message string)

Info prints an info message

func (*OutputProvider) List

func (op *OutputProvider) List(items []string)

List prints a list

func (*OutputProvider) Newline

func (op *OutputProvider) Newline()

Newline prints a newline

func (*OutputProvider) NumberedList

func (op *OutputProvider) NumberedList(items []string)

NumberedList prints a numbered list

func (*OutputProvider) Print

func (op *OutputProvider) Print(message string)

Print prints a message

func (*OutputProvider) Printf

func (op *OutputProvider) Printf(format string, args ...interface{})

Printf prints a formatted message

func (*OutputProvider) Println

func (op *OutputProvider) Println(message string)

Println prints a message with a newline

func (*OutputProvider) Progress

func (op *OutputProvider) Progress(current, total int, message string)

Progress prints a progress bar

func (*OutputProvider) Quote

func (op *OutputProvider) Quote(quote string, author string)

Quote prints a quote

func (*OutputProvider) Section

func (op *OutputProvider) Section(title string)

Section prints a section header

func (*OutputProvider) Separator

func (op *OutputProvider) Separator()

Separator prints a separator line

func (*OutputProvider) SetColors

func (op *OutputProvider) SetColors(colors bool)

SetColors enables or disables colors

func (*OutputProvider) SetVerbose

func (op *OutputProvider) SetVerbose(verbose bool)

SetVerbose enables or disables verbose output

func (*OutputProvider) SetWriter

func (op *OutputProvider) SetWriter(writer io.Writer)

SetWriter sets the output writer

func (*OutputProvider) Spinner

func (op *OutputProvider) Spinner(message string)

Spinner prints a spinner

func (*OutputProvider) Subsection

func (op *OutputProvider) Subsection(title string)

Subsection prints a subsection header

func (*OutputProvider) Success

func (op *OutputProvider) Success(message string)

Success prints a success message

func (*OutputProvider) Table

func (op *OutputProvider) Table(headers []string, rows [][]string)

Table prints a table

func (*OutputProvider) Verbose

func (op *OutputProvider) Verbose(message string)

Verbose prints a verbose message

func (*OutputProvider) Warning

func (op *OutputProvider) Warning(message string)

Warning prints a warning message

type PerformanceMetrics

type PerformanceMetrics struct {
	AvgResponseTime string
	MaxResponseTime string
	Throughput      int
	ErrorRate       float64
	MemoryUsage     string
	CPUUsage        float64
}

type Permission

type Permission struct {
	ID          string
	Name        string
	Description string
	CreatedAt   string
}

type ProjectCommands

type ProjectCommands struct{}

ProjectCommands handles project-related commands

func NewProjectCommands

func NewProjectCommands() *ProjectCommands

func (*ProjectCommands) MakeCommand

func (pc *ProjectCommands) MakeCommand(ctx *cli.Context) error

func (*ProjectCommands) MakeController

func (pc *ProjectCommands) MakeController(ctx *cli.Context) error

func (*ProjectCommands) MakeMiddleware

func (pc *ProjectCommands) MakeMiddleware(ctx *cli.Context) error

func (*ProjectCommands) MakeModel

func (pc *ProjectCommands) MakeModel(ctx *cli.Context) error

func (*ProjectCommands) MakeModule

func (pc *ProjectCommands) MakeModule(ctx *cli.Context) error

func (*ProjectCommands) MakeSchema

func (pc *ProjectCommands) MakeSchema(ctx *cli.Context) error

func (*ProjectCommands) Register

func (pc *ProjectCommands) Register(app *cli.App)

type ProjectGenerator

type ProjectGenerator struct {
	ProjectName    string
	Template       string
	IncludeGraphQL bool
}

ProjectGenerator handles project creation

func NewProjectGenerator

func NewProjectGenerator(projectName, template string, includeGraphQL bool) *ProjectGenerator

NewProjectGenerator creates a new project generator

func (*ProjectGenerator) CreateBasicStructure

func (pg *ProjectGenerator) CreateBasicStructure() error

CreateBasicStructure creates the basic project structure (exported for potential future use)

func (*ProjectGenerator) Generate

func (pg *ProjectGenerator) Generate() error

Generate creates a new Mithril project

type ProjectValidator

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

ProjectValidator provides project validation

func NewProjectValidator

func NewProjectValidator() *ProjectValidator

NewProjectValidator creates a new project validator

func (*ProjectValidator) ValidateModuleName

func (pv *ProjectValidator) ValidateModuleName(name string) error

ValidateModuleName validates a module name

func (*ProjectValidator) ValidateProjectName

func (pv *ProjectValidator) ValidateProjectName(name string) error

ValidateProjectName validates a project name

type QueueCommands

type QueueCommands struct{}

QueueCommands contains all queue-related commands

func NewQueueCommands

func NewQueueCommands() *QueueCommands

NewQueueCommands creates a new queue commands instance

func (*QueueCommands) QueueClear

func (qc *QueueCommands) QueueClear(ctx *cli.Context) error

QueueClear clears all jobs from the queue

func (*QueueCommands) QueueFailed

func (qc *QueueCommands) QueueFailed(ctx *cli.Context) error

QueueFailed lists failed jobs

func (*QueueCommands) QueueFlush

func (qc *QueueCommands) QueueFlush(ctx *cli.Context) error

QueueFlush flushes failed jobs

func (*QueueCommands) QueueMonitor

func (qc *QueueCommands) QueueMonitor(ctx *cli.Context) error

QueueMonitor monitors queue status

func (*QueueCommands) QueueRestart

func (qc *QueueCommands) QueueRestart(ctx *cli.Context) error

QueueRestart restarts queue workers

func (*QueueCommands) QueueRetry

func (qc *QueueCommands) QueueRetry(ctx *cli.Context) error

QueueRetry retries failed jobs

func (*QueueCommands) QueueSize

func (qc *QueueCommands) QueueSize(ctx *cli.Context) error

QueueSize gets queue size

func (*QueueCommands) QueueWork

func (qc *QueueCommands) QueueWork(ctx *cli.Context) error

QueueWork starts queue worker

func (*QueueCommands) Register

func (qc *QueueCommands) Register()

Register registers all queue commands

type QueueStats

type QueueStats struct {
	Pending    int
	Processing int
	Completed  int
	Failed     int
}

type QueueValidator

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

QueueValidator provides queue validation

func NewQueueValidator

func NewQueueValidator() *QueueValidator

NewQueueValidator creates a new queue validator

func (*QueueValidator) ValidateConnectionName

func (qv *QueueValidator) ValidateConnectionName(name string) error

ValidateConnectionName validates a connection name

func (*QueueValidator) ValidateQueueName

func (qv *QueueValidator) ValidateQueueName(name string) error

ValidateQueueName validates a queue name

type RBACCommands

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

RBACCommands provides commands for RBAC management

func NewRBACCommands

func NewRBACCommands(db *gorm.DB) *RBACCommands

NewRBACCommands creates a new RBACCommands instance

func (*RBACCommands) AssignPermission

func (r *RBACCommands) AssignPermission(permissionSlug, roleSlug string) error

AssignPermission assigns a permission to a role

func (*RBACCommands) AssignRole

func (r *RBACCommands) AssignRole(userEmail, roleSlug string) error

AssignRole assigns a role to a user

func (*RBACCommands) CreatePermission

func (r *RBACCommands) CreatePermission(name, slug, resource, action, description string) error

CreatePermission creates a new permission

func (*RBACCommands) CreateRole

func (r *RBACCommands) CreateRole(name, slug, description string) error

CreateRole creates a new role

func (*RBACCommands) ListPermissions

func (r *RBACCommands) ListPermissions() error

ListPermissions lists all permissions

func (*RBACCommands) ListRoles

func (r *RBACCommands) ListRoles() error

ListRoles lists all roles

func (*RBACCommands) SeedDefaultRBACData

func (r *RBACCommands) SeedDefaultRBACData() error

SeedDefaultRBACData seeds default roles and permissions

func (*RBACCommands) ShowUserPermissions

func (r *RBACCommands) ShowUserPermissions(userEmail string) error

ShowUserPermissions shows all permissions for a user

type RanMigration

type RanMigration struct {
	Name       string
	Batch      int
	ExecutedAt time.Time
}

type Role

type Role struct {
	ID          string
	Name        string
	Description string
	CreatedAt   string
}

type Route

type Route struct {
	Method string
	Path   string
	Name   string
}

type ScheduledTask

type ScheduledTask struct {
	Name     string
	Schedule string
	LastRun  string
	NextRun  string
	Status   string
}

type SeedCommand

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

SeedCommand handles seeder commands

func NewSeedCommand

func NewSeedCommand(manager *connection.Manager) *SeedCommand

NewSeedCommand creates a new seed command

func (*SeedCommand) Run

func (sc *SeedCommand) Run(args []string) error

Run runs the seed command

type SeederFile

type SeederFile struct {
	Name string
	Path string
}

type SimpleModuleGenerator

type SimpleModuleGenerator struct {
	ModuleName string
	Flags      ModuleFlags
}

SimpleModuleGenerator handles the creation of new modules (simplified version)

func NewSimpleModuleGenerator

func NewSimpleModuleGenerator(moduleName string, flags ModuleFlags) *SimpleModuleGenerator

NewSimpleModuleGenerator creates a new SimpleModuleGenerator instance

func (*SimpleModuleGenerator) Generate

func (mg *SimpleModuleGenerator) Generate() error

Generate creates a new module

type StorageCommands

type StorageCommands struct{}

StorageCommands contains all storage-related commands

func NewStorageCommands

func NewStorageCommands() *StorageCommands

NewStorageCommands creates a new storage commands instance

func (*StorageCommands) Register

func (sc *StorageCommands) Register()

Register registers all storage commands

func (*StorageCommands) StorageBackup

func (sc *StorageCommands) StorageBackup(ctx *cli.Context) error

StorageBackup backs up storage files

func (*StorageCommands) StorageClean

func (sc *StorageCommands) StorageClean(ctx *cli.Context) error

StorageClean cleans storage files

func (*StorageCommands) StorageDelete

func (sc *StorageCommands) StorageDelete(ctx *cli.Context) error

StorageDelete deletes file from storage

func (*StorageCommands) StorageDownload

func (sc *StorageCommands) StorageDownload(ctx *cli.Context) error

StorageDownload downloads file from storage

func (sc *StorageCommands) StorageLink(ctx *cli.Context) error

StorageLink creates symbolic link to storage

func (*StorageCommands) StorageList

func (sc *StorageCommands) StorageList(ctx *cli.Context) error

StorageList lists storage files

func (*StorageCommands) StorageRestore

func (sc *StorageCommands) StorageRestore(ctx *cli.Context) error

StorageRestore restores storage files

func (*StorageCommands) StorageSize

func (sc *StorageCommands) StorageSize(ctx *cli.Context) error

StorageSize gets storage size

func (*StorageCommands) StorageSync

func (sc *StorageCommands) StorageSync(ctx *cli.Context) error

StorageSync syncs storage with remote

func (*StorageCommands) StorageUpload

func (sc *StorageCommands) StorageUpload(ctx *cli.Context) error

StorageUpload uploads file to storage

type StorageFile

type StorageFile struct {
	Name string
	Size string
}

type StorageValidator

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

StorageValidator provides storage validation

func NewStorageValidator

func NewStorageValidator() *StorageValidator

NewStorageValidator creates a new storage validator

func (*StorageValidator) ValidateBucketName

func (sv *StorageValidator) ValidateBucketName(name string) error

ValidateBucketName validates a bucket name

func (*StorageValidator) ValidateStoragePath

func (sv *StorageValidator) ValidateStoragePath(path string) error

ValidateStoragePath validates a storage path

type User

type User struct {
	ID        string
	Email     string
	Name      string
	Roles     []string
	CreatedAt string
}

type UtilityCommands

type UtilityCommands struct{}

UtilityCommands contains all utility-related commands

func NewUtilityCommands

func NewUtilityCommands() *UtilityCommands

NewUtilityCommands creates a new utility commands instance

func (*UtilityCommands) CacheClear

func (uc *UtilityCommands) CacheClear(ctx *cli.Context) error

CacheClear clears application cache

func (*UtilityCommands) CacheForget

func (uc *UtilityCommands) CacheForget(ctx *cli.Context) error

CacheForget removes specific cache key

func (*UtilityCommands) Decrypt

func (uc *UtilityCommands) Decrypt(ctx *cli.Context) error

Decrypt decrypts a value

func (*UtilityCommands) Encrypt

func (uc *UtilityCommands) Encrypt(ctx *cli.Context) error

Encrypt encrypts a value

func (*UtilityCommands) EventGenerate

func (uc *UtilityCommands) EventGenerate(ctx *cli.Context) error

EventGenerate generates event and listener

func (*UtilityCommands) Hash

func (uc *UtilityCommands) Hash(ctx *cli.Context) error

Hash hashes a value

func (*UtilityCommands) KeyGenerate

func (uc *UtilityCommands) KeyGenerate(ctx *cli.Context) error

KeyGenerate generates application key

func (*UtilityCommands) Register

func (uc *UtilityCommands) Register()

Register registers all utility commands

func (*UtilityCommands) RouteList

func (uc *UtilityCommands) RouteList(ctx *cli.Context) error

RouteList lists all routes

func (*UtilityCommands) ScheduleRun

func (uc *UtilityCommands) ScheduleRun(ctx *cli.Context) error

ScheduleRun runs scheduled tasks

func (*UtilityCommands) ScheduleWork

func (uc *UtilityCommands) ScheduleWork(ctx *cli.Context) error

ScheduleWork starts schedule worker

func (*UtilityCommands) VendorPublish

func (uc *UtilityCommands) VendorPublish(ctx *cli.Context) error

VendorPublish publishes vendor assets

type ValidationResult

type ValidationResult struct {
	Valid    bool
	Errors   map[string][]string
	Warnings map[string][]string
}

ValidationResult represents the result of validation

func NewValidationResult

func NewValidationResult() *ValidationResult

NewValidationResult creates a new validation result

func (*ValidationResult) AddError

func (vr *ValidationResult) AddError(field, message string)

AddError adds an error to the result

func (*ValidationResult) AddWarning

func (vr *ValidationResult) AddWarning(field, message string)

AddWarning adds a warning to the result

func (*ValidationResult) GetErrorMessages

func (vr *ValidationResult) GetErrorMessages() []string

GetErrorMessages gets all error messages

func (*ValidationResult) GetWarningMessages

func (vr *ValidationResult) GetWarningMessages() []string

GetWarningMessages gets all warning messages

func (*ValidationResult) HasErrors

func (vr *ValidationResult) HasErrors() bool

HasErrors checks if there are errors

func (*ValidationResult) HasWarnings

func (vr *ValidationResult) HasWarnings() bool

HasWarnings checks if there are warnings

type ValidationRule

type ValidationRule struct {
	Required bool
	Min      int
	Max      int
	Pattern  string
	Custom   func(interface{}) error
}

ValidationRule defines a validation rule

type Validator

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

Validator provides validation functionality for CLI commands

func NewValidator

func NewValidator() *Validator

NewValidator creates a new validator

func (*Validator) AddRule

func (v *Validator) AddRule(field string, rule ValidationRule)

AddRule adds a validation rule

func (*Validator) Validate

func (v *Validator) Validate(field string, value interface{}) error

Validate validates a field

func (*Validator) ValidateAll

func (v *Validator) ValidateAll(data map[string]interface{}) error

ValidateAll validates all fields

Jump to

Keyboard shortcuts

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