client

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2025 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

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 AppendConfig(filename string) error

func CheckErr

func CheckErr(err error)

func CobraAddCommand

func CobraAddCommand(cobraRootCmd, parentCmd, cobraCmd CobraCommand)

func CobraInit

func CobraInit(cobraRootCmd CobraCommand)

func ConfigDir

func ConfigDir() string

func ConfigEdit

func ConfigEdit()

func ConfigInit

func ConfigInit(allowClobber bool) string

func ConfigString

func ConfigString(header bool) string

func Confirm

func Confirm(prompt string) bool

func EncodeToken

func EncodeToken(gmailAddress, token string) string

func Expand

func Expand(value string) string

func Fatal

func Fatal(err error) error

func Fatalf

func Fatalf(format string, args ...interface{}) error

func FormatJSON

func FormatJSON(v any) string

func FormatToken

func FormatToken(gmailAddress, token string) string

func FormatYAML

func FormatYAML(value any) string

func GetHostnameDetail

func GetHostnameDetail() (string, string, string, error)

func HexDump

func HexDump(data []byte) string

func HostDomain

func HostDomain() (string, error)

func HostFQDN

func HostFQDN() (string, error)

func HostShortname

func HostShortname() (string, error)

func Init

func Init(name, version, configFile string)

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(pathname string) bool

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 Shutdown

func Shutdown()

func TildePath

func TildePath(path string) (string, error)

func ViperGet

func ViperGet(key string) any

func ViperGetBool

func ViperGetBool(key string) bool

func ViperGetInt

func ViperGetInt(key string) int

func ViperGetInt64

func ViperGetInt64(key string) int64

func ViperGetString

func ViperGetString(key string) string

func ViperGetStringMapString

func ViperGetStringMapString(key string) map[string]string

func ViperGetStringSlice

func ViperGetStringSlice(key string) []string

func ViperKey

func ViperKey(key string) string

func ViperSet

func ViperSet(key string, value any)

func ViperSetDefault

func ViperSetDefault(key string, value any)

func Warning

func Warning(format string, args ...interface{})

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)
}

func NewAPIClient

func NewAPIClient(prefix, url, certFile, keyFile, caFile string, headers *map[string]string) (APIClient, error)

type Auth

type Auth struct {
	Address string
	Token   string
	// contains filtered or unexported fields
}

func (*Auth) Next

func (a *Auth) Next(fromServer []byte, more bool) ([]byte, error)

func (*Auth) Start

func (a *Auth) Start(info *smtp.ServerInfo) (string, []byte, error)

type CobraCommand

type CobraCommand interface {
}

type Relay

type Relay struct {
	Hostname   string
	Sender     string
	Recipients []string
	// contains filtered or unexported fields
}

func NewRelay

func NewRelay(hostname, sender string, recipients []string) (*Relay, error)

func (*Relay) RelayData

func (r *Relay) RelayData(conn io.Reader, wc io.WriteCloser) (uint64, error)

func (*Relay) Send

func (r *Relay) Send(conn io.Reader) (int, string, error)

type Sendmail

type Sendmail interface {
	Send(to, from, subject string, body []byte) error
}

func NewSendmail

func NewSendmail(hostname string, port int, username, password, CAFile string) (Sendmail, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL