Documentation ¶
Index ¶
- Variables
- func AskForBool(text string, def bool, skip bool) (bool, error)
- func AskForConfirmation(text string, skip bool) bool
- func AskForString(text, def string, skip bool) (string, error)
- func IsValidStatus(s string) bool
- func IsValidTweetID(s string) bool
- func IsValidUserID(s string) bool
- func IsValidUsername(s string) bool
- func ParseTweetFromArgs(arg string, isFile bool) (int64, error)
- func ParseTweetStatusFromArgs(arg string, isFile bool) (status string, err error)
- func ParseUserFromArgs(arg string, isFile bool) (userID int64, name string, err error)
- type LineReader
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrParseUserFromStdin is returned when the user alias from stdin cannot be parsed ErrParseUserFromStdin = errors.New("invalid user id or account name from stdin") // ErrParseTweetFromStdin is returned when the tweet id from stdin cannot be parsed ErrParseTweetFromStdin = errors.New("invalid tweet id from stdin") // ErrParseInput is returned if the input from stdin cannot be parsed ErrParseInput = errors.New("failed parse input from stdin") // ErrAbortInput is returned if the user aborted input action ErrAbortInput = errors.New("waiting for input was aborted") // ErrUnknownInput is returned if the user entered an unknown action ErrUnknownInput = errors.New("unknown answer entered") )
Functions ¶
func AskForBool ¶
AskForBool requires user bool input
func AskForConfirmation ¶
AskForConfirmation asks a yes/no question until the user replies yes or no
func AskForString ¶
AskForString requires user text input
func IsValidStatus ¶
IsValidStatus returns wether the status is valid
func IsValidTweetID ¶
IsValidTweetID checks wether the tweet id is valid or not
func IsValidUserID ¶
IsValidUserID checks wether the user id is valid or not
func IsValidUsername ¶
IsValidUsername returns wether the provided user name is valid or not
func ParseTweetFromArgs ¶
ParseTweetFromArgs parses tweet id from stdin
func ParseTweetStatusFromArgs ¶
ParseTweetStatusFromArgs parses tweet text from args
Types ¶
type LineReader ¶
type LineReader struct {
// contains filtered or unexported fields
}
LineReader is an unbuffered line reader
func (LineReader) ReadLine ¶
func (lr LineReader) ReadLine() (string, error)
ReadLine reads one line without buffering
Click to show internal directories.
Click to hide internal directories.