goclitools

package module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: MIT Imports: 20 Imported by: 2

README

goclitools

Collection of tools for creating cli apps.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(text string) bool

Confirm input confirm

func ConfirmWithDefault

func ConfirmWithDefault(text string, defaultValue bool) bool

ConfirmWithDefault with default value

func Log

func Log(m ...interface{})

Log ...

func LogSection

func LogSection(title string, m ...interface{})

LogSection ...

func Logf

func Logf(f string, m ...interface{})

Logf ...

func OAuth2GetToken

func OAuth2GetToken(conf *oauth2.Config) (*oauth2.Token, error)

OAuth2GetToken Create local http server and use it to get access token from oauth authorization provider

func PrintChecking

func PrintChecking(message string)

PrintChecking ...

func PrintNotOK

func PrintNotOK()

PrintNotOK ...

func PrintOK

func PrintOK()

PrintOK ...

func Prompt

func Prompt(text string) string

Prompt ...

func PromptCached

func PromptCached(text, key string) string

PromptCached ...

func PromptSecret

func PromptSecret(text string) string

PromptSecret ...

func PromptSecretCached

func PromptSecretCached(text, key string) string

PromptSecretCached ...

func PromptWithChoice

func PromptWithChoice(name string, choices []string) (int, error)

PromptWithChoice ...

func PromptWithMultiChoice

func PromptWithMultiChoice(name string, choices []string) ([]int, error)

PromptWithMultiChoice ...

func ReflectionFill

func ReflectionFill(o interface{}) error

ReflectionFill ...

func ReflectionFillUsingObject

func ReflectionFillUsingObject(o interface{}, useExistingValues bool) error

ReflectionFillUsingObject ...

func Run

func Run(cmd string) ([]byte, error)

Run ...

func RunInDir

func RunInDir(cmd, dir string) ([]byte, error)

RunInDir ...

func RunInteractive

func RunInteractive(cmd string) error

RunInteractive ...

func RunInteractiveInDir

func RunInteractiveInDir(cmd, dir string) error

RunInteractiveInDir ...

func RunSecure

func RunSecure(cmd string, secrets []string) ([]byte, error)

RunSecure ...

func RunSecureInDir

func RunSecureInDir(cmd, dir string, secrets []string) ([]byte, error)

RunSecureInDir ...

func RunSecureInteractive

func RunSecureInteractive(cmd string, secrets []string) error

RunSecureInteractive ...

func RunSecureInteractiveInDir

func RunSecureInteractiveInDir(cmd, dir string, secrets []string) error

RunSecureInteractiveInDir ...

func RunWithInput

func RunWithInput(cmd string, input []byte) ([]byte, error)

RunWithInput ...

func SecureByteArray

func SecureByteArray(input []byte, secrets []string) []byte

SecureByteArray ...

func SecureStd

func SecureStd(out *os.File, secrets []string) *os.File

SecureStd ...

func SecureString

func SecureString(input string, secrets []string) string

SecureString ...

Types

type Dependency

type Dependency struct {
	Name               string
	CheckCmd           string
	CheckCmdValidation string
	Dependencies       []Dependency
	InstallScripts     []DependencyScript
	UninstallScripts   []DependencyScript
}

Dependency struct

func DependencyDocker

func DependencyDocker() Dependency

DependencyDocker docker dependency

func DependencyFastlane

func DependencyFastlane() Dependency

DependencyFastlane fastlane dependency

func DependencyFastlaneMatch

func DependencyFastlaneMatch() Dependency

DependencyFastlaneMatch fastlane dependency

func DependencyGit

func DependencyGit() Dependency

DependencyGit git dependency

func DependencyHomebrew

func DependencyHomebrew() Dependency

DependencyHomebrew dependency homebrew

func DependencyXcodebuild

func DependencyXcodebuild() Dependency

DependencyXcodebuild Xcode build

func (*Dependency) Check

func (d *Dependency) Check() (bool, error)

Check checks the dependency

func (*Dependency) Install

func (d *Dependency) Install() error

Install installs the dependency

func (*Dependency) Uninstall

func (d *Dependency) Uninstall() error

Uninstall uninstalls the dependency

type DependencyScript

type DependencyScript interface {
	Run() error
}

DependencyScript interface - has to implement Run

type DependencyScriptFn

type DependencyScriptFn struct {
	Fn func() error
}

DependencyScriptFn interface - has to implement Run

func (DependencyScriptFn) Run

func (script DependencyScriptFn) Run() error

Run runs the interface's fn

type DependencyScriptString

type DependencyScriptString struct {
	Fn string
}

DependencyScriptString interface

func (DependencyScriptString) Run

func (script DependencyScriptString) Run() error

Run runs the dependency

Jump to

Keyboard shortcuts

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