middleware

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLogin

func CheckLogin(cmd *cobra.Command, args []string) error

CheckLogin checks if the user is logged in and the session is valid

func CheckPnpmInstalled

func CheckPnpmInstalled(cmd *cobra.Command, args []string) error

CheckPnpmInstalled checks if pnpm is installed in the system path

func Compose

func Compose(checks ...CommandCheck) func(cmd *cobra.Command, args []string) error

Compose combines multiple checks into a single function compatible with Cobra's PreRunE

Types

type CommandCheck

type CommandCheck func(cmd *cobra.Command, args []string) error

CommandCheck is a function that performs a check before a command is run

func CheckNodeVersion

func CheckNodeVersion(minVersion string) CommandCheck

CheckNodeVersion checks if node is installed and meets the minimum version requirement

type MiddlewareError

type MiddlewareError struct {
	Title      string
	Suggestion string
	Err        error
}

MiddlewareError is a custom error type that includes a title and suggestion

func (*MiddlewareError) Error

func (e *MiddlewareError) Error() string

func (*MiddlewareError) Unwrap

func (e *MiddlewareError) Unwrap() error

Jump to

Keyboard shortcuts

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