core

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Source: https://github.com/goware/prefixer

Singleton module

Index

Constants

View Source
const ANSI = "" /* 129-byte string literal not displayed */

Variables

View Source
var CONFIG_MAN []byte
View Source
var CONFIG_MD []byte

Functions

func AnyToString added in v0.10.0

func AnyToString(s any) string

func CheckIfError

func CheckIfError(err error)

func CreateManPage

func CreateManPage(desc string, version string, date string, rootCmd *cobra.Command, cmds ...*cobra.Command) error

func DebugPrint

func DebugPrint(data any)

func Exit added in v0.10.0

func Exit(err error)

func FindFileInParentDirs

func FindFileInParentDirs(path string, files []string) (string, error)

func FormatShell added in v0.10.0

func FormatShell(shell string) string

FormatShell returns the shell program and associated command flag

func GenManPages

func GenManPages(dir string) error

func GetAbsolutePath

func GetAbsolutePath(configDir string, path string, name string) (string, error)

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 Intersection

func Intersection(a []string, b []string) []string

func Ptr

func Ptr[T any](t T) *T

Used when creating pointers to literal. Useful when you want set/unset attributes.

func StringInSlice

func StringInSlice(a string, list []string) bool

func StringsToErrors

func StringsToErrors(str []string) []error

func Strip

func Strip(str string) string

Types

type AlreadySakeDirectory

type AlreadySakeDirectory struct {
	Dir string
}

func (*AlreadySakeDirectory) Error

func (c *AlreadySakeDirectory) Error() string

type ConfigEnvFailed

type ConfigEnvFailed struct {
	Name string
	Err  string
}

func (*ConfigEnvFailed) Error

func (c *ConfigEnvFailed) Error() string

type ConfigErr

type ConfigErr struct {
	Msg string
}

func (*ConfigErr) Error

func (f *ConfigErr) Error() string

type ConfigNotFound

type ConfigNotFound struct {
	Names []string
}

func (*ConfigNotFound) Error

func (f *ConfigNotFound) Error() string

type FileError

type FileError struct {
	Err string
}

func (*FileError) Error

func (f *FileError) Error() string

type ListFlags

type ListFlags struct {
	Output string
	Theme  string
}

type Loader

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

func GetSpinner

func GetSpinner() *Loader

func (*Loader) Disable

func (s *Loader) Disable()

func (*Loader) Enable

func (s *Loader) Enable()

func (*Loader) Message

func (s *Loader) Message(msg string)

func (*Loader) Start

func (s *Loader) Start(msg string, delay time.Duration)

func (*Loader) Status

func (s *Loader) Status() yacspin.SpinnerStatus

func (*Loader) Stop

func (s *Loader) Stop()

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 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

func NewPrefixer(r io.Reader, prefix string) *Prefixer

New creates a new instance of Prefixer.

func (*Prefixer) Read

func (r *Prefixer) Read(p []byte) (n int, err error)

Read implements io.Reader. It reads data into p from the underlying reader and prepends every line with a prefix. It does not block if no data is available yet. It returns the number of bytes read into p.

func (*Prefixer) WriteTo

func (r *Prefixer) WriteTo(w io.Writer) (n int64, err error)

type RunFlags

type RunFlags struct {
	// Flags
	Edit     bool
	DryRun   bool
	Describe bool

	// Target
	All     bool
	Servers []string
	Tags    []string
	Cwd     bool

	// Config
	KnownHostsFile string

	// Task
	Theme  string
	TTY    bool
	Attach bool
	Local  bool

	// Server
	IdentityFile string
	Password     string

	// Spec
	Parallel          bool
	AnyErrorsFatal    bool
	IgnoreErrors      bool
	IgnoreUnreachable bool
	OmitEmpty         bool
	Output            string
}

type ServerFlags

type ServerFlags struct {
	Tags    []string
	Headers []string
	Edit    bool
}

type ServerNotFound

type ServerNotFound struct {
	Name []string
}

func (*ServerNotFound) Error

func (c *ServerNotFound) Error() string

type SetRunFlags

type SetRunFlags struct {
	Parallel          bool
	OmitEmpty         bool
	Local             bool
	TTY               bool
	AnyErrorsFatal    bool
	IgnoreErrors      bool
	IgnoreUnreachable bool
}

type SpecNotFound

type SpecNotFound struct {
	Name string
}

func (*SpecNotFound) Error

func (c *SpecNotFound) Error() string

type TagFlags

type TagFlags struct {
	Headers []string
}

type TagNotFound

type TagNotFound struct {
	Tags []string
}

func (*TagNotFound) Error

func (c *TagNotFound) Error() string

type TargetNotFound

type TargetNotFound struct {
	Name string
}

func (*TargetNotFound) Error

func (c *TargetNotFound) Error() string

type TaskFlags

type TaskFlags struct {
	Headers []string
	Edit    bool
}

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
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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