Skip to content

Instantly share code, notes, and snippets.

View Mr-Malomz's full-sized avatar

Demola Malomo Mr-Malomz

  • Lagos, Nigeria
View GitHub Profile
package api
import (
"context"
"go-sms-verification/data"
"net/http"
"time"
"github.com/gin-gonic/gin"
)
package api
import (
"github.com/twilio/twilio-go"
twilioApi "github.com/twilio/twilio-go/rest/verify/v2"
)
var client *twilio.RestClient = twilio.NewRestClientWithParams(twilio.ClientParams{
Username: envACCOUNTSID(),
Password: envAUTHTOKEN(),
package api
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/go-playground/validator/v10"
)
type jsonResponse struct {
package api
import "github.com/gin-gonic/gin"
type Config struct {
Router *gin.Engine
}
func (app *Config) Routes() {
//routes will come here
package data
type OTPData struct {
PhoneNumber string `json:"phoneNumber,omitempty" validate:"required"`
}
type VerifyData struct {
User *OTPData `json:"user,omitempty" validate:"required"`
Code string `json:"code,omitempty" validate:"required"`
}
package api
import (
"log"
"os"
"github.com/joho/godotenv"
)
func envACCOUNTSID() string {
use yew::prelude::*;
mod components;
mod models;
use gloo_net::{http::Request, Error}; //add
use models::user::Users; //add
use components::{card::Card, header::Header, loader::Loader, message::Message}; //add
pub mod user;
pub mod header;
pub mod loader;
pub mod card;
pub mod message;
use yew::prelude::*;
use crate::models::user::User;
#[derive(Properties, PartialEq)]
pub struct CardProp {
pub user: User,
}
#[function_component(Card)]
pub fn card(CardProp { user }: &CardProp) -> Html {