async

package
v0.0.0-...-0ca6d7b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncSMSService

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

NOTE: Use Singleton to fire only one go routine that reprogram async send.

func NewAsyncSMSService

func NewAsyncSMSService(
	ctx context.Context,
	smsSvc sms.Service,
	asyncRepo repository.AsyncSMSRepository,
	opts *AsyncSMSServiceOptions,
) *AsyncSMSService

func (*AsyncSMSService) Send

func (a *AsyncSMSService) Send(
	ctx context.Context,
	toNb string,
	body string,
	args ...string,
) error

type AsyncSMSServiceOptions

type AsyncSMSServiceOptions struct {
	PollInterval time.Duration
	RetryTimes   int
	// For twilio, it could be 20504 Twilio Internal Error
	RetryErrorCodes []int
}

Jump to

Keyboard shortcuts

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