una

package module
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

una 统一通知方案接入

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvertisingSms

func AdvertisingSms(targets ...string) *optionSms

AdvertisingSms 配置营销(广告)短信

func AkSk

func AkSk(ak string, sk string) *optionAkSk

AkSk 配置邮件服务

func AppKey added in v1.0.5

func AppKey(key string) *optionAppKey

AppKey 配置应用

func BCC

func BCC(emails ...string) *optionBCC

BCC 配置秘送列表

func CC

func CC(emails ...string) *optionCC

CC 配置抄送列表

func CommonSms

func CommonSms(target string) *optionSms

CommonSms 配置普通短信

func EmailAuth

func EmailAuth(host string, port int, username string, password string) *optionEmailAuth

EmailAuth 配置邮件服务

func HtmlEmail

func HtmlEmail(name string, from string, to ...string) *optionEmailContent

HtmlEmail 配置富文本邮件

func NewOptions added in v1.0.4

func NewOptions(opts ...option) []option

NewOptions 创建空选项列表

func NotifySms

func NotifySms(target string) *optionSms

NotifySms 配置通知短信

func PlainEmail

func PlainEmail(name string, from string, to ...string) *optionEmailContent

PlainEmail 配置普通邮件

func Subject

func Subject(subject string) *optionSubject

Subject 配置主题

func Template added in v1.0.3

func Template(data interface{}) *optionTemplate

Template 配置主题

Types

type Chuangcache added in v1.0.2

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

Chuangcache 创世云短信

func NewChuangcache added in v1.0.2

func NewChuangcache(resty *resty.Request) (chuangcache *Chuangcache)

NewChuangcache 创建创世云短信

func (*Chuangcache) Send added in v1.0.2

func (c *Chuangcache) Send(ctx context.Context, content string, opts ...option) (id string, err error)

type Email

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

Email 邮件通知

func NewEmail

func NewEmail() (email *Email)

NewEmail 创建普通邮件

func (*Email) Send

func (e *Email) Send(ctx context.Context, content string, opts ...option) (id string, err error)

type EmailType

type EmailType string

EmailType 邮件类型

const (
	// EmailTypeHtml 富文本邮件
	EmailTypeHtml EmailType = "html"
	// EmailTypePlain 普通文本邮件
	EmailTypePlain EmailType = "plain"
)

type SmsType

type SmsType int

SmsType 短信类型

const (
	// SmsTypeCommon 普通短信
	SmsTypeCommon SmsType = 1
	// SmsTypeNotify 通知短信
	SmsTypeNotify SmsType = 2
	// SmsTypeAdvertising 营销短信
	SmsTypeAdvertising SmsType = 3
)

type Type

type Type string

Type 通知类型

const (
	// TypeChuangcache 创世云短信服务
	TypeChuangcache Type = "chuangcache"
	// TypeEmail 邮件通知
	TypeEmail Type = "email"
)

type Una

type Una interface {
	// Send 发送消息
	Send(ctx context.Context, content string, opts ...option) (id string, err error)
}

Una 通知接口

func New

func New(resty *resty.Request) Una

New 创建适配器

Jump to

Keyboard shortcuts

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