Documentation ¶
Overview ¶
Source: https://github.com/goware/prefixer
Singleton module ¶
TODO: Refactor
Index ¶
- Constants
- Variables
- func AnyToString(s any) string
- func CheckIfError(err error)
- func CreateManPage(desc string, version string, date string, rootCmd *cobra.Command, ...) error
- func DebugPrint(data any)
- func EvaluateInventory(shell string, context string, input string, serverEnvs []string, ...) ([]string, error)
- func EvaluateRange(input string) ([]string, error)
- func Exit(err error)
- func ExpandPath(p string) (string, error)
- func FindFileInParentDirs(path string, files []string) (string, error)
- func FormatShell(shell string) string
- func GenManPages(dir string) error
- func GetAbsolutePath(configDir string, path string, name string) (string, error)
- func GetFirstExistingFile(files ...string) string
- func Intersection(a []string, b []string) []string
- func IsDigit(s string) bool
- func ParseHostName(hostname string, defaultUser string, defaultPort uint16) (string, string, uint16, error)
- func ParseSSHConfig(path string) (map[string](Endpoint), error)
- func Ptr[T any](t T) *T
- func SplitString(s, sep string) []string
- func StringInSlice(a string, list []string) bool
- func StringToBool(s string) bool
- func StringsToErrors(str []string) []error
- func Strip(str string) string
- type AlreadySakeDirectory
- type BatchMultipleDef
- type ConfigEnvFailed
- type ConfigErr
- type ConfigNotFound
- type Endpoint
- type ExecError
- type FileError
- type HostPart
- type HostRange
- type HostString
- type InvalidPercentInput
- type InvalidPercentInput2
- type InventoryEvalFailed
- type LimitMultipleDef
- type ListFlags
- type Loader
- type MultipleFailSet
- type NoEditorEnv
- type NoRemoteServerToAttach
- type NoTaskRefDefined
- type OutputFormatNotFound
- type PasswordEvalFailed
- type Prefixer
- type RangeState
- type RegisterInvalidName
- type RunFlags
- type ServerBastionMultipleDef
- type ServerFlags
- type ServerMultipleDef
- type ServerNotFound
- type SetRunFlags
- type SpecFlags
- type SpecNotFound
- type SpecsNotFound
- type TagFlags
- type TagNotFound
- type TargetFlags
- type TargetNotFound
- type TargetsNotFound
- type TaskFlags
- type TaskMultipleDef
- type TaskNotFound
- type TaskRefMultipleDef
- type TemplateParseError
- type ThemeNotFound
- type ZeroNotAllowed
Constants ¶
const ( Start = 0 End = 1 Step = 2 )
const ANSI = "" /* 129-byte string literal not displayed */
Variables ¶
var CONFIG_MAN []byte
var CONFIG_MD []byte
var RE = regexp.MustCompile(ANSI)
Functions ¶
func AnyToString ¶ added in v0.10.0
func CheckIfError ¶
func CheckIfError(err error)
func CreateManPage ¶
func EvaluateInventory ¶ added in v0.12.0
func EvaluateInventory( shell string, context string, input string, serverEnvs []string, userEnvs []string, ) ([]string, error)
Separate hosts with newline and space/tab
func EvaluateRange ¶ added in v0.12.0
func ExpandPath ¶ added in v0.15.1
func FormatShell ¶ added in v0.10.0
FormatShell returns the shell program and associated command flag
func GenManPages ¶
func GetAbsolutePath ¶
Get the absolute path Need to support following path types:
lala/land ./lala/land ../lala/land /lala/land $HOME/lala/land ~/lala/land ~root/lala/land
func GetFirstExistingFile ¶ added in v0.14.0
func Intersection ¶
func ParseHostName ¶ added in v0.11.0
func ParseHostName(hostname string, defaultUser string, defaultPort uint16) (string, string, uint16, error)
Parse host, for instance : user@hostname:22
func ParseSSHConfig ¶ added in v0.12.0
Parse reads and parses the file in the given path.
func Ptr ¶
func Ptr[T any](t T) *T
Used when creating pointers to literal. Useful when you want set/unset attributes.
func SplitString ¶ added in v0.13.0
func StringInSlice ¶
func StringToBool ¶ added in v0.11.0
func StringsToErrors ¶
Types ¶
type AlreadySakeDirectory ¶
type AlreadySakeDirectory struct {
Dir string
}
func (*AlreadySakeDirectory) Error ¶
func (c *AlreadySakeDirectory) Error() string
type BatchMultipleDef ¶ added in v0.13.0
type BatchMultipleDef struct {
Name string
}
func (*BatchMultipleDef) Error ¶ added in v0.13.0
func (c *BatchMultipleDef) Error() string
type ConfigEnvFailed ¶
func (*ConfigEnvFailed) Error ¶
func (c *ConfigEnvFailed) Error() string
type ConfigNotFound ¶
type ConfigNotFound struct {
Names []string
}
func (*ConfigNotFound) Error ¶
func (f *ConfigNotFound) Error() string
type Endpoint ¶ added in v0.11.0
type ExecError ¶ added in v0.10.2
If there's a misconfiguration somewhere, not associated with server errors
type HostString ¶ added in v0.12.0
type HostString struct {
Value string
}
type InvalidPercentInput ¶ added in v0.12.0
type InvalidPercentInput struct {
Name string
}
func (*InvalidPercentInput) Error ¶ added in v0.12.0
func (c *InvalidPercentInput) Error() string
type InvalidPercentInput2 ¶ added in v0.14.0
type InvalidPercentInput2 struct {
Name string
}
func (*InvalidPercentInput2) Error ¶ added in v0.14.0
func (c *InvalidPercentInput2) Error() string
type InventoryEvalFailed ¶ added in v0.12.0
type InventoryEvalFailed struct {
Err string
}
func (*InventoryEvalFailed) Error ¶ added in v0.12.0
func (c *InventoryEvalFailed) Error() string
type LimitMultipleDef ¶ added in v0.13.0
type LimitMultipleDef struct {
Name string
}
func (*LimitMultipleDef) Error ¶ added in v0.13.0
func (c *LimitMultipleDef) Error() string
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func GetSpinner ¶
func GetSpinner() *Loader
func (*Loader) Status ¶
func (s *Loader) Status() yacspin.SpinnerStatus
type MultipleFailSet ¶ added in v0.13.0
type MultipleFailSet struct {
Name string
}
func (*MultipleFailSet) Error ¶ added in v0.13.0
func (c *MultipleFailSet) Error() string
type NoEditorEnv ¶
type NoEditorEnv struct{}
func (*NoEditorEnv) Error ¶
func (c *NoEditorEnv) Error() string
type NoRemoteServerToAttach ¶
type NoRemoteServerToAttach struct{}
func (*NoRemoteServerToAttach) Error ¶
func (c *NoRemoteServerToAttach) Error() string
type NoTaskRefDefined ¶ added in v0.10.0
type NoTaskRefDefined struct {
Name string
}
func (*NoTaskRefDefined) Error ¶ added in v0.10.0
func (c *NoTaskRefDefined) Error() string
type OutputFormatNotFound ¶ added in v0.13.0
type OutputFormatNotFound struct {
Name string
}
func (*OutputFormatNotFound) Error ¶ added in v0.13.0
func (c *OutputFormatNotFound) Error() string
type PasswordEvalFailed ¶
type PasswordEvalFailed struct {
Err string
}
func (*PasswordEvalFailed) Error ¶
func (c *PasswordEvalFailed) Error() string
type Prefixer ¶
type Prefixer struct {
// contains filtered or unexported fields
}
Prefixer implements io.Reader and io.WriterTo. It reads data from the underlying reader and prepends every line with a given string.
func NewPrefixer ¶
New creates a new instance of Prefixer.
type RangeState ¶ added in v0.12.0
type RangeState uint64
func (RangeState) String ¶ added in v0.12.0
func (s RangeState) String() string
type RegisterInvalidName ¶ added in v0.13.0
type RegisterInvalidName struct {
Value string
}
func (*RegisterInvalidName) Error ¶ added in v0.13.0
func (c *RegisterInvalidName) Error() string
type RunFlags ¶
type RunFlags struct { // Flags Edit bool DryRun bool Describe bool ListHosts bool Silent bool Confirm bool Step bool Verbose bool // Reports Report []string // Target All bool Regex string Servers []string Tags []string Cwd bool Invert bool Limit uint32 LimitP uint8 Target string Order string // Config KnownHostsFile string // Task Theme string TTY bool Attach bool Local bool // Server IdentityFile string User string Password string // Spec Spec string AnyErrorsFatal bool MaxFailPercentage uint8 IgnoreErrors bool IgnoreUnreachable bool OmitEmptyRows bool OmitEmptyColumns bool Forks uint32 Batch uint32 BatchP uint8 Output string Print string Strategy string }
type ServerBastionMultipleDef ¶ added in v0.15.0
type ServerBastionMultipleDef struct {
Name string
}
func (*ServerBastionMultipleDef) Error ¶ added in v0.15.0
func (c *ServerBastionMultipleDef) Error() string
type ServerFlags ¶
type ServerMultipleDef ¶ added in v0.12.0
type ServerMultipleDef struct {
Name string
}
func (*ServerMultipleDef) Error ¶ added in v0.12.0
func (c *ServerMultipleDef) Error() string
type ServerNotFound ¶
type ServerNotFound struct {
Name []string
}
func (*ServerNotFound) Error ¶
func (c *ServerNotFound) Error() string
type SetRunFlags ¶
type SetRunFlags struct { Silent bool Describe bool ListHosts bool Attach bool All bool Invert bool OmitEmptyRows bool OmitEmptyColumns bool Local bool TTY bool AnyErrorsFatal bool IgnoreErrors bool IgnoreUnreachable bool Order bool Report bool Forks bool Batch bool BatchP bool Servers bool Tags bool Regex bool Limit bool LimitP bool Verbose bool Confirm bool Step bool MaxFailPercentage bool }
type SpecNotFound ¶
type SpecNotFound struct {
Name string
}
func (*SpecNotFound) Error ¶
func (c *SpecNotFound) Error() string
type SpecsNotFound ¶ added in v0.12.0
type SpecsNotFound struct {
Specs []string
}
func (*SpecsNotFound) Error ¶ added in v0.12.0
func (c *SpecsNotFound) Error() string
type TagNotFound ¶
type TagNotFound struct {
Tags []string
}
func (*TagNotFound) Error ¶
func (c *TagNotFound) Error() string
type TargetFlags ¶ added in v0.12.0
type TargetNotFound ¶
type TargetNotFound struct {
Name string
}
func (*TargetNotFound) Error ¶
func (c *TargetNotFound) Error() string
type TargetsNotFound ¶ added in v0.12.0
type TargetsNotFound struct {
Targets []string
}
func (*TargetsNotFound) Error ¶ added in v0.12.0
func (c *TargetsNotFound) Error() string
type TaskMultipleDef ¶
type TaskMultipleDef struct {
Name string
}
func (*TaskMultipleDef) Error ¶
func (c *TaskMultipleDef) Error() string
type TaskNotFound ¶
type TaskNotFound struct {
IDs []string
}
func (*TaskNotFound) Error ¶
func (c *TaskNotFound) Error() string
type TaskRefMultipleDef ¶ added in v0.10.0
type TaskRefMultipleDef struct {
Name string
}
func (*TaskRefMultipleDef) Error ¶ added in v0.10.0
func (c *TaskRefMultipleDef) Error() string
type TemplateParseError ¶ added in v0.10.0
type TemplateParseError struct {
Msg string
}
If there's a misconfiguration with golang templates (prefix/header for instance in text.go)
func (*TemplateParseError) Error ¶ added in v0.10.0
func (f *TemplateParseError) Error() string
type ThemeNotFound ¶
type ThemeNotFound struct {
Name string
}
func (*ThemeNotFound) Error ¶
func (c *ThemeNotFound) Error() string
type ZeroNotAllowed ¶ added in v0.14.0
type ZeroNotAllowed struct {
Name string
}
func (*ZeroNotAllowed) Error ¶ added in v0.14.0
func (c *ZeroNotAllowed) Error() string