Documentation
¶
Overview ¶
Package config provides types and functions to collect, validate and apply user-provided settings.
Index ¶
Constants ¶
const DefaultNagiosNotificationTimeout time.Duration = 30 * time.Second
DefaultNagiosNotificationTimeout is the default timeout value for Nagios 3 and 4 installations. This is our *default* timeout ceiling.
Variables ¶
var ErrVersionRequested = errors.New("version information requested")
ErrVersionRequested indicates that the user requested application version information.
Functions ¶
func Branding ¶
func Branding()
Branding is responsible for emitting application name, version and origin
func MessageTrailer ¶
MessageTrailer generates a branded "footer" for use with submitted Teams messages. If specified, the sending or "generator" application is credited as the source of the message, while this application is credited as the delivery agent/mechanism.
Types ¶
type Config ¶
type Config struct { // Team is the human-readable name of the Microsoft Teams "team" that // contains the channel we wish to post a message to. This is used in // informational output produced by this application only; the remote API // does not receive this value. Team string // Channel is human-readable name of the channel within a specific // Microsoft Teams "team". This is used in informational output produced // by this application only; the remote API does not receive this value. Channel string // WebhookURL is the full URL used to submit messages to the Teams channel // This URL is in the form of https://outlook.office.com/webhook/xxx or // https://outlook.office365.com/webhook/xxx. This URL is REQUIRED in // order for this application to function and needs to be created in // advance by adding/configuring a Webhook Connector in a Microsoft Teams // channel that you wish to submit messages to using this application. WebhookURL string // ThemeColor is a hex color code string representing the desired border // trim color for our submitted messages. ThemeColor string // MessageTitle is the text shown on the top portion of the message "card" // that is displayed in Microsoft Teams for the message that we send. MessageTitle string // MessageText is an (optionally) Markdown-formatted string representing // the message that we will submit. MessageText string // Sender is an optional value provided to indicate what application was // responsible for generating the message that this one will attempt to // deliver. Sender string // TargetURLs is the collection of user-specified URLs and descriptions // that should be displayed as actionable links or "buttons" within the // generated Microsoft Teams message. TargetURLs targetURLsStringFlag // Retries is the number of attempts that this application will make // to deliver messages before giving up. Retries int // RetriesDelay is the number of seconds to wait between retry attempts. RetriesDelay int // Whether detailed output should be shown after message submission // success or failure. VerboseOutput bool // Whether ANY output should be shown after message submission success or // failure. SilentOutput bool // Whether messages with Windows, Mac and Linux newlines are updated to // use break statements before message submission. ConvertEOL bool // ShowVersion is a flag indicating whether the user opted to display only // the version string and then immediately exit the application ShowVersion bool }
Config is a unified set of configuration values for this application. This struct is configured via command-line flags provided by the user.
func NewConfig ¶
NewConfig is a factory function that produces a new Config object based on user provided flag values.
func (Config) TeamsSubmissionTimeout ¶ added in v0.4.11
TeamsSubmissionTimeout is the timeout value for sending messages to Microsoft Teams.
type TargetURL ¶ added in v0.6.0
type TargetURL struct { // URL to be used as the target for labelled "buttons" within a Microsoft // Teams message. URL url.URL // Description is the text used as the label for link "buttons" within a // Microsoft Teams message. Description string }
TargetURL is a URL and description provided by the user for use with generating potentialAction entries for display as "buttons" in the generated Microsoft Teams message.