Documentation
¶
Index ¶
- Variables
- func AliasCmd() *cobra.Command
- func DefaultConfigFile() string
- func DefaultDir() string
- func EmailProvider() (email.Provider, error)
- func ErrorExit(err error, cmd *cobra.Command)
- func ErrorNoExit(err error)
- func Execute()
- func RootCmd() *cobra.Command
- func StorageProvider() (storage.Provider, error)
- func ValidateInputs(domain, alias *string, emailAddresses *[]string) error
- Bugs
Constants ¶
This section is empty.
Variables ¶
var ( // Rev represents the revision. When built via CI, this is replaced with Git // SHA1 by the linker. Rev string = "HEAD" // Ver represents the version. When built via CI, this is replaced with Git // tag it's built with. Ver string = "development version" )
Functions ¶
func AliasCmd ¶
AliasCmd returns a pointer to the aliasCmd variable for the alias subcommands that are in a separate package.
func DefaultConfigFile ¶
func DefaultConfigFile() string
DefaultConfigFile returns the specified config file name or the default if one has not beeen specified.
func DefaultDir ¶
func DefaultDir() string
DefaultDir returns the standard directory for the aliasman configuration data.
BUG(patsoffice) this is very UNIX centric. BUG(patsoffice) this function should return an eror and not exit from here
func EmailProvider ¶
EmailProvider returns an email provider of the type specified in a Viper string. If a provider that is specified does not exist or there was a problem creating the provider, an error is returned.
func ErrorExit ¶
ErrorExit takes an error value and possibly pointer to a Cobra command. The error value is printed to stderr. If the pointer to the Cobra command is non-nil, it's Help() method is run. THe program is then run with a non-zero exit value.
BUG(patsoffice) allow exit values to be passed? Necessary? BUG(patsoffice) allow setting of a Writer so that something other than stderr can be used?
func ErrorNoExit ¶
func ErrorNoExit(err error)
ErrorNoExit takes and error value and outputs it to stderr. BUG(patsoffice) allow setting of a Writer so that something other than stderr can be used?
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func RootCmd ¶
RootCmd returns a pointer to the root command so that other modules can manipulate it. This primarily so providers can add their options to the global flags via their init() funtions.
func StorageProvider ¶
StorageProvider returns a storage provider of the type specified in a Viper string. If a provider that is specified does not exist or there was a problem creating the provider, an error is returned.
func ValidateInputs ¶
ValidateInputs ensures that valid input is provided for domain, alias and email addresses. If empty input is given for domain and email addresses, we attempt to retrieve defaults from the Viper configuration.
Types ¶
This section is empty.
Notes ¶
Bugs ¶
this is very UNIX centric.
this function should return an eror and not exit from here
this is very UNIX centric. Different for different platforms?
allow exit values to be passed? Necessary?
allow setting of a Writer so that something other than stderr can be used?
allow setting of a Writer so that something other than stderr can be used?