22 lines
392 B
Go
22 lines
392 B
Go
package sms
|
|
|
|
import (
|
|
"context"
|
|
"server/internal/model"
|
|
)
|
|
|
|
type SMSClient interface {
|
|
SendCode(ctx context.Context, in *model.SMSCodeIn) (out *model.SMSCodeOut, err error)
|
|
}
|
|
|
|
var clients = make(map[string]SMSClient)
|
|
|
|
func Register(name string, client SMSClient) {
|
|
clients[name] = client
|
|
}
|
|
|
|
func GetClient(name string) (SMSClient, bool) {
|
|
client, ok := clients[name]
|
|
return client, ok
|
|
}
|