tencent

package
v0.0.0-...-6a8978f Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DEFAULT_TENCENT_SMS_ENDPOINT todo
	DEFAULT_TENCENT_SMS_ENDPOINT = "sms.tencentcloudapi.com"
)

Variables

This section is empty.

Functions

func NewSender

func NewSender(conf *Config) (sms_provider.SmsNotifyer, error)

Types

type Config

type Config struct {
	Endpoint  string `bson:"endpoint" json:"endpoint" env:"SMS_TENCENT_ENDPOINT"`
	SecretID  string `bson:"secret_id" json:"secret_id" validate:"required,lte=64" env:"SMS_TENCENT_SECRET_ID"`
	SecretKey string `bson:"secret_key" json:"secret_key" validate:"required,lte=64" env:"SMS_TENCENT_SECRET_KEY"`
	AppID     string `bson:"app_id" json:"app_id" validate:"required,lte=64" env:"SMS_TENCENT_APPID"`
	Sign      string `bson:"sign" json:"sign" validate:"required,lte=128" env:"SMS_TENCENT_SIGN"`
}

接口和相关文档请参考https://console.cloud.tencent.com/api/explorer?Product=sms&Version=2019-07-11&Action=SendSms&SignVersion=

func LoadConfigFromEnv

func LoadConfigFromEnv() (*Config, error)

LoadConfigFromEnv todo

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig todo

func (*Config) Desensitize

func (c *Config) Desensitize()

Desensitize 脱敏

func (*Config) GetEndpoint

func (s *Config) GetEndpoint() string

GetEndpoint todo

func (*Config) Validate

func (s *Config) Validate() error

Validate todo

type Sender

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

func (*Sender) Send

Send todo

Jump to

Keyboard shortcuts

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