provider

package
v0.0.0-...-c1a7e98 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AILIYUNProvider

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

AILIYUNProvider is a struct represents a sms provider.

func NewAILIYUNProvider

func NewAILIYUNProvider(typ types.ProviderType, rds *redis.Client, logger *writer.Writer, ailiyunSmsOptions *ailiyunoptions.SmsOptions) *AILIYUNProvider

NewAILIYUNProvider returns a new provider for aili cloud sms.

func (*AILIYUNProvider) Send

Send creates a sms client and sends sms by aili cloud.

func (*AILIYUNProvider) Type

type DummyProvider

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

DummyProvider is a struct represents a fake sms provider.

func NewDummyProvider

func NewDummyProvider(typ types.ProviderType) *DummyProvider

NewDummyProvider returns a new provider for fake action.

func (*DummyProvider) Send

Send do nothing

func (*DummyProvider) Type

func (p *DummyProvider) Type() types.ProviderType

type Provider

type Provider interface {
	// Type 返回 Provider 类型
	Type() types.ProviderType
	// Send 发送短信
	Send(ctx context.Context, rq *types.TemplateMsgRequest) (TemplateMsgResponse, error)
}

type ProviderFactory

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

ProviderFactory is a struct that acts as a factory for creating and managing instances

func NewProviderFactory

func NewProviderFactory() *ProviderFactory

NewProviderFactory creates a new instance of ProviderFactory with an empty map of providers.

func (*ProviderFactory) GetSMSTemplateProvider

func (f *ProviderFactory) GetSMSTemplateProvider(providerType types.ProviderType) (Provider, error)

GetSMSTemplateProvider retrieves an SMS template provider based on the given provider type.

func (*ProviderFactory) RegisterProvider

func (f *ProviderFactory) RegisterProvider(providerType types.ProviderType, provider Provider)

RegisterProvider registers an SMS template provider.

type TemplateMsgResponse

type TemplateMsgResponse struct {
	Code      string
	Message   string
	BizId     string
	RequestId string
}

TemplateMsgResponse

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳