sms

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPhone   = errors.New("sms: invalid phone")
	ErrInvalidMessage = errors.New("sms: invalid message")
)

Functions

This section is empty.

Types

type Content

type Content struct {
	Text      string
	Template  string
	Variables map[string]string
}

type Message

type Message struct {
	Phone   *Phone
	Content *Content
}

type NullProvider

type NullProvider struct{}

func (*NullProvider) Send

func (p *NullProvider) Send(_ context.Context, _ *Message) error

type Phone

type Phone struct {
	IDDCode string
	Number  string
}

type Provider

type Provider interface {
	Send(ctx context.Context, message *Message) error
}

func NewNullProvider

func NewNullProvider() Provider

type Sms

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

func New

func New(provider Provider) *Sms

func (*Sms) Send

func (s *Sms) Send(ctx context.Context, message *Message) error

Directories

Path Synopsis
Package mitake is a sms provider for mitake.
Package mitake is a sms provider for mitake.

Jump to

Keyboard shortcuts

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