types

package
v0.0.0-...-63a0d86 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StdoutPrompter = func(msg string, needConfirm bool) {
	fmt.Fprintln(os.Stdout, msg)
	if needConfirm {
		fmt.Fprintln(os.Stdout, "Press [Enter] to confirm")
		scanner := bufio.NewScanner(os.Stdin)
		scanner.Scan()

		scanner.Err()
	}
}

StdoutPrompter uses stdin and stdout to prompt user information

Functions

This section is empty.

Types

type Prompter

type Prompter func(msg string, needConfirm bool)

Prompter provides a way to prompt user information

type URLOpener

type URLOpener func(url string)

URLOpener is the function opens URL for user

var BrowserOpener URLOpener = func(url string) {

	browser.OpenURL(url)
}

BrowserOpener opens URL by opening browser

func PromptOpener

func PromptOpener(propter Prompter) URLOpener

PromptOpener opens URL by prompt message to user

Jump to

Keyboard shortcuts

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