28 lines
553 B
Go
28 lines
553 B
Go
package interfaces
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
)
|
|
|
|
type Email interface {
|
|
InitEmail(ctx context.Context, opt ...Option) (Email, error)
|
|
// Send 发送邮件
|
|
Send(ctx context.Context, params Message) error
|
|
}
|
|
|
|
type DefaultEmail struct{}
|
|
|
|
func (l *DefaultEmail) InitEmail(ctx context.Context, opt ...Option) (Email, error) {
|
|
return &DefaultEmail{}, errors.New("not implemented")
|
|
}
|
|
|
|
func (l *DefaultEmail) Send(ctx context.Context, params Message) error {
|
|
return errors.New("not implemented")
|
|
}
|
|
|
|
// 初始化一个接口
|
|
|
|
// 实际执行一个接口
|
|
|