smsclient

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

func Provide

func Provide() fx.Option

Types

type Client

type Client interface {
	SendHTML(to, content, subject string) error
}

func NewSmtPool

func NewSmtPool(conf *Config) (Client, error)

type CodeGenerator

type CodeGenerator interface {
	Generate(length int) string
}

func NewRandomNumberCodeGenerator

func NewRandomNumberCodeGenerator() CodeGenerator

type Config

type Config struct {
	Host               string
	Port               int
	MaxConns           int
	IdleTimeout        int
	PoolWaitTimeout    int
	From               string
	UserName           string
	Password           string
	AuthType           string
	SSL                bool `json:"ssl" yaml:"ssl"`
	InsecureSkipVerify bool
}

func NewConfig

func NewConfig(v *viper.Viper, logger *zap.Logger) (*Config, error)

type RandomNumberCodeGenerator

type RandomNumberCodeGenerator struct {
	// contains filtered or unexported fields
}

func (*RandomNumberCodeGenerator) Generate

func (m *RandomNumberCodeGenerator) Generate(length int) string

type SmtpPool

type SmtpPool struct {
	// contains filtered or unexported fields
}

func (*SmtpPool) SendHTML

func (sp *SmtpPool) SendHTML(to, content, subject string) error

Jump to

Keyboard shortcuts

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