Documentation
¶
Index ¶
- func Describe(name, shortDesc string)
- func PrintError(message string)
- func PrintInfo(message string)
- func PrintOK(message string)
- func PrintRed(message string)
- type Result
- func New(status Status, message string) Result
- func NewCreated(message string) Result
- func NewError(message string) Result
- func NewInfo(message string) Result
- func NewRemoved(message string) Result
- func NewUnchanged(message string) Result
- func NewUpdated(message string) Result
- func Run(runner func() Result) Result
- func (result Result) IsCreated() bool
- func (result Result) IsError() bool
- func (result Result) IsFailure() bool
- func (result Result) IsInfo() bool
- func (result Result) IsRemoved() bool
- func (result Result) IsSuccess() bool
- func (result Result) IsUnchanged() bool
- func (result Result) IsUpdated() bool
- func (result Result) Message() string
- func (result Result) Print()
- func (result Result) SetMessage(message string)
- func (result Result) StandardizeMessage(name, value string) Result
- func (result Result) Status() Status
- type Set
- func (results *Set) Add(res Result) Set
- func (results Set) DefaultMessage() string
- func (results Set) IsEmpty() bool
- func (results Set) IsSuccess() bool
- func (results Set) Message() string
- func (results Set) OverallResult() Result
- func (results Set) Print()
- func (results *Set) SetMessage(message string)
- func (results Set) Size() int
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Describe ¶
func Describe(name, shortDesc string)
Describe prints the name in color, and the shortDesc using normal color. A newline is appended.
func PrintError ¶
func PrintError(message string)
PrintError prints an error message. A newline is appended.
func PrintInfo ¶
func PrintInfo(message string)
PrintInfo prints an info message. A newline is appended.
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result type
func NewCreated ¶
NewCreated constructs a Created Result object
func NewRemoved ¶
NewRemoved constructs a Removed Result object
func NewUnchanged ¶
NewUnchanged constructs an Unchanged Result object
func NewUpdated ¶
NewUpdated constructs an Updated Result object
func (Result) StandardizeMessage ¶
StandardizeMessage constructs a Result object with a standardized message
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set helps managing a set of Result
func (Set) DefaultMessage ¶
DefaultMessage computes a default message based on the object state.
func (Set) OverallResult ¶
OverallResult gets a result object for the all set.
Click to show internal directories.
Click to hide internal directories.