Documentation
¶
Index ¶
- Constants
- Variables
- func AppendConfig(filename string) error
- func CheckErr(err error)
- func CobraAddCommand(cobraRootCmd, parentCmd, cobraCmd CobraCommand)
- func CobraInit(cobraRootCmd CobraCommand)
- func ConfigDir() string
- func ConfigEdit()
- func ConfigInit(allowClobber bool) string
- func ConfigString(header bool) string
- func Confirm(prompt string) bool
- func EncodeToken(gmailAddress, token string) string
- func Expand(value string) string
- func Fatal(err error) error
- func Fatalf(format string, args ...interface{}) error
- func FormatJSON(v any) string
- func FormatToken(gmailAddress, token string) string
- func FormatYAML(value any) string
- func GetHostnameDetail() (string, string, string, error)
- func HexDump(data []byte) string
- func HostDomain() (string, error)
- func HostFQDN() (string, error)
- func HostShortname() (string, error)
- func Init(name, version, configFile string)
- func IsDir(path string) bool
- func IsFile(pathname string) bool
- func OptionInt(cobraCmd CobraCommand, name, flag string, defaultValue int, description string)
- func OptionKey(cobraCmd CobraCommand, key string) string
- func OptionString(cobraCmd CobraCommand, name, flag, defaultValue, description string)
- func OptionStringSlice(cobraCmd CobraCommand, name, flag string, defaultValue []string, ...)
- func OptionSwitch(cobraCmd CobraCommand, name, flag, description string)
- func ProgramName() string
- func ProgramVersion() string
- func Shutdown()
- func TildePath(path string) (string, error)
- func ViperGet(key string) any
- func ViperGetBool(key string) bool
- func ViperGetInt(key string) int
- func ViperGetInt64(key string) int64
- func ViperGetString(key string) string
- func ViperGetStringMapString(key string) map[string]string
- func ViperGetStringSlice(key string) []string
- func ViperKey(key string) string
- func ViperSet(key string, value any)
- func ViperSetDefault(key string, value any)
- func Warning(format string, args ...interface{})
- type APIClient
- type Auth
- type CobraCommand
- type Relay
- type Sendmail
- type TokenResponse
Constants ¶
View Source
const Version = "0.1.13"
Variables ¶
View Source
var FROM_PATTERN = regexp.MustCompile(`^From:[[:space:]]+(.*)[[:space:]]+<([^>]+)>.*$`)
View Source
var HEADER_PATTERN = regexp.MustCompile(`^([^[:space:]]+):[[:space:]]+[^[:space:]]+.*`)
Functions ¶
func AppendConfig ¶
func CobraAddCommand ¶
func CobraAddCommand(cobraRootCmd, parentCmd, cobraCmd CobraCommand)
func CobraInit ¶
func CobraInit(cobraRootCmd CobraCommand)
func ConfigEdit ¶
func ConfigEdit()
func ConfigInit ¶
func ConfigString ¶
func EncodeToken ¶
func FormatJSON ¶
func FormatToken ¶
func FormatYAML ¶
func HostDomain ¶
func HostShortname ¶
func OptionInt ¶
func OptionInt(cobraCmd CobraCommand, name, flag string, defaultValue int, description string)
func OptionKey ¶
func OptionKey(cobraCmd CobraCommand, key string) string
func OptionString ¶
func OptionString(cobraCmd CobraCommand, name, flag, defaultValue, description string)
func OptionStringSlice ¶
func OptionStringSlice(cobraCmd CobraCommand, name, flag string, defaultValue []string, description string)
func OptionSwitch ¶
func OptionSwitch(cobraCmd CobraCommand, name, flag, description string)
func ProgramName ¶
func ProgramName() string
func ProgramVersion ¶
func ProgramVersion() string
func ViperGetBool ¶
func ViperGetInt ¶
func ViperGetInt64 ¶
func ViperGetString ¶
func ViperGetStringMapString ¶
func ViperGetStringSlice ¶
func ViperSetDefault ¶
Types ¶
type APIClient ¶
type APIClient interface {
Close()
Get(path string, response interface{}) (string, error)
Post(path string, request, response interface{}, headers *map[string]string) (string, error)
Put(path string, request, response interface{}, headers *map[string]string) (string, error)
Delete(path string, response interface{}) (string, error)
SetFlag(string, bool) error
StatusCode() (int, bool)
}
type CobraCommand ¶
type CobraCommand interface {
}
type Relay ¶
type Relay struct {
Hostname string
Sender string
Recipients []string
// contains filtered or unexported fields
}
type TokenResponse ¶
type TokenResponse struct {
Success bool
Request string
Message string
User string
Gmail string
Local string
Token string
}
func RequestToken ¶
func RequestToken(username string) (*TokenResponse, error)
Click to show internal directories.
Click to hide internal directories.