Reviewed-on: phoenix/twilio_sender#1
Co-authored-by: kdeng00 <kundeng94@gmail.com>
Co-committed-by: kdeng00 <kundeng94@gmail.com>
This commit is contained in:
kdeng00
2024-08-24 21:20:30 +00:00
committed by phoenix
parent fda603e0c0
commit 7b55ff5be2
14 changed files with 383 additions and 30 deletions
+65
View File
@@ -0,0 +1,65 @@
package models
import (
"fmt"
)
type Number struct {
PhoneNumber string `json:"number"`
}
func (nbr Number) IsEmpty() bool {
if nbr.PhoneNumber == "" {
return true
} else {
return false
}
}
func PrintNumbers(numbers [](Number)) {
for _, element := range numbers {
fmt.Println("Phone number:", element.PhoneNumber)
}
}
type Message struct {
Text string `json:"text"`
}
func (msg Message) IsEmpty() bool {
if msg.Text == "" {
return true
} else {
return false
}
}
func (msg Message) Print() {
fmt.Println("Message:", msg.Text)
}
type TwiloDetails struct {
AccountSID string `json:"account_sid"`
ServiceSID string `json:"service_sid"`
URI string `json:"uri"`
AuthToken string `json:"auth_token"`
Number string `json:"number"`
}
func (config TwiloDetails) PrintConfig() {
fmt.Printf("Account SID: %s\n", config.AccountSID)
fmt.Printf("Service SID: %s\n", config.ServiceSID)
fmt.Println("URI:", config.URI)
fmt.Printf("Auth Token: %s\n", config.AuthToken)
fmt.Printf("Number: %s\n", config.Number)
}
func Init() TwiloDetails {
return TwiloDetails{
"",
"",
"",
"",
"",
}
}