Documentation ¶
Overview ¶
Package config provides types and functions to collect, validate and apply user-provided settings.
Index ¶
Constants ¶
View Source
const TeamsSubmissionTimeout time.Duration = 5 * time.Second
TeamsSubmissionTimeout is the timeout value for sending messages to Microsoft Teams. This value is used to build a context with the desired timeout value.
Variables ¶
This section is empty.
Functions ¶
func Branding ¶
func Branding()
Branding is responsible for emitting application name, version and origin
func MessageTrailer ¶
func MessageTrailer() string
MessageTrailer generates a branded "footer" for use with submitted Teams messages.
Types ¶
type Config ¶
type Config struct { // 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 // 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 // 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.
Click to show internal directories.
Click to hide internal directories.