Documentation
¶
Overview ¶
Package tips provides utilities for displaying helpful tips to users during specific workflows. Tips are informational messages that can help users troubleshoot issues or learn about features.
Tips can be disabled globally using --no-tips or individually using --no-tip <tip-name>.
Index ¶
Constants ¶
const (
// DebuggingDocs is the tip that points users to the debugging documentation.
DebuggingDocs = "debugging-docs"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InvalidTipNameError ¶
type InvalidTipNameError struct {
// contains filtered or unexported fields
}
InvalidTipNameError is an error that is returned when an invalid tip name is requested.
func NewInvalidTipNameError ¶
func NewInvalidTipNameError(requestedName string, allowedNames []string) *InvalidTipNameError
func (InvalidTipNameError) Error ¶
func (err InvalidTipNameError) Error() string
func (InvalidTipNameError) Is ¶
func (err InvalidTipNameError) Is(target error) bool
type Tip ¶
type Tip struct {
// Name is a unique identifier for the tip
Name string
// Message is the message to display when the tip is triggered
Message string
// OnceShow is a sync.Once to ensure the tip is only shown once per session
OnceShow sync.Once
// contains filtered or unexported fields
}
Tip represents a helpful tip displayed to users.
type Tips ¶
type Tips []*Tip
Tips is a collection of Tip pointers.
func NewTips ¶
func NewTips() Tips
NewTips returns a new Tips collection with all available tips.
Never remove any of these tips, as removing them will cause a breaking change for users using an invocation of `--no-tip` pointing to a non-existent tip.
e.g. `terragrunt run --no-tip=debugging-docs`
If you want to programmatically document that a tip should no longer be used after removing it from the codebase, just set `disabled` to `1` here for that tip.
func (Tips) DisableAll ¶
func (t Tips) DisableAll()
DisableAll disables all tips such that they aren't shown.
func (Tips) DisableTip ¶
DisableTip validates that the specified tip name is valid and disables this tip.