sms

package module
v0.0.0-...-e8cbe85 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 5 Imported by: 0

README

Sms

GoDoc

A collection of phone number provider wrappers

Documentation
Installation
go get github.com/saucesteals/sms

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMetadata = errors.New("sms: invalid metadata type")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	GetPhoneNumber(ctx context.Context, service string, country string) (*PhoneNumber, error)
	GetMessages(ctx context.Context, phoneNumber *PhoneNumber) ([]string, error)
	CancelPhoneNumber(ctx context.Context, phoneNumber *PhoneNumber) error
	ReportPhoneNumber(ctx context.Context, phoneNumber *PhoneNumber) error
}

type Matcher

type Matcher struct {
	MatcherFn MatcherFn
	Delay     time.Duration
	Timeout   time.Duration
}

func NewMatcher

func NewMatcher(matcher MatcherFn, delay time.Duration, timeout time.Duration) *Matcher

func (*Matcher) WaitForMessage

func (m *Matcher) WaitForMessage(ctx context.Context, client Client, phoneNumber *PhoneNumber) (string, error)

type MatcherFn

type MatcherFn func(message string) (match string)

type PhoneNumber

type PhoneNumber struct {
	*phonenumbers.PhoneNumber
	Metadata any
	// contains filtered or unexported fields
}

func (*PhoneNumber) Cancelled

func (p *PhoneNumber) Cancelled() bool

func (*PhoneNumber) Format

func (*PhoneNumber) MarkCancelled

func (p *PhoneNumber) MarkCancelled()

func (*PhoneNumber) MarkUsed

func (p *PhoneNumber) MarkUsed()

func (*PhoneNumber) Reuse

func (p *PhoneNumber) Reuse()

func (*PhoneNumber) Used

func (p *PhoneNumber) Used() bool

type ReusableClient

type ReusableClient interface {
	Client
	ReusePhoneNumber(ctx context.Context, phoneNumber *PhoneNumber) (*PhoneNumber, error)
}

Directories

Path Synopsis
examples
internal
gen
Code generated by saucesteals/sms; DO NOT EDIT.
Code generated by saucesteals/sms; DO NOT EDIT.
gen
Code generated by saucesteals/sms; DO NOT EDIT.
Code generated by saucesteals/sms; DO NOT EDIT.
gen
Code generated by saucesteals/sms; DO NOT EDIT.
Code generated by saucesteals/sms; DO NOT EDIT.
gen
Code generated by saucesteals/sms; DO NOT EDIT.
Code generated by saucesteals/sms; DO NOT EDIT.
gen

Jump to

Keyboard shortcuts

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