Skip to content

Instantly share code, notes, and snippets.

View muhammadisa's full-sized avatar
🚀
Keep grow

Muhammad Isa muhammadisa

🚀
Keep grow
View GitHub Profile
package repository
import (
"database/sql"
"github.com/nightsilvertech/cake/src/repository/cakeRepository"
)
type Pool struct {
CakeRepository cakeRepository.Repository
}
package cakeRepository
import (
"context"
"database/sql"
"github.com/nightsilvertech/cake/src/model/model"
)
const (
WriteCakeSQLS = `INSERT INTO cakes(id, title, rating , image, description, created_at, updated_at) VALUES (?,?,?,?,?,?,?)`
package usecase
import (
"github.com/nightsilvertech/cake/src/repository"
"github.com/nightsilvertech/cake/src/usecase/cakeUsecase"
)
type Pool struct {
CakeUsecase cakeUsecase.Usecase
}
program_id merch_id max_amount max_usage nik max_amount_limit max_usage_limit
26f9a933-db4a-4430-b1de-3be60cc49d97 081235910912 1000000 100 1234285928958298 1000000 100
26f9a933-db4a-4430-b1de-3be60cc49d97 081219192920 1000000 100 1234512093928409 1000000 100
26f9a933-db4a-4430-b1de-3be60cc49d97 081290900921 1000000 100 1234293089389411 1000000 100
26f9a933-db4a-4430-b1de-3be60cc49d97 081298989128 1000000 100 1234984910988529 1000000 100
program_id cust_id max_amount max_usage nik max_amount_limit max_usage_limit
26f9a933-db4a-4430-b1de-3be60cc49d97 081299001199 1000000 100 1234285928191002 1000000 100
26f9a933-db4a-4430-b1de-3be60cc49d97 081228888118 1000000 100 1234567891231928 1000000 100
26f9a933-db4a-4430-b1de-3be60cc49d97 081211990022 1000000 100 1234567891182858 1000000 100
26f9a933-db4a-4430-b1de-3be60cc49d97 081277338817 1000000 100 1234560291092083 1000000 100
package main
import (
"encoding/csv"
"errors"
"fmt"
"net/http"
"reflect"
"strings"
)
package generator
import (
"github.com/stretchr/testify/suite"
"testing"
)
// otpTestSuite embedding suite.Suite of testify
type otpTestSuite struct {
suite.Suite
package generator
import (
"crypto/rand"
"errors"
"fmt"
)
func OTP(length int) (string, error) {
const otpChars = "1234567890"
func main() {
databaseUrl := fmt.Sprintf(
"%s:%s@tcp(%s:%s)/%s?parseTime=true",
"root",
"root",
"localhost",
"3306",
"example",
)
db, err := sql.Open("mysql", databaseUrl)
package repository
func (r repo) WriteExample(example Example) error {
const query = `INSERT INTO example(content) VALUES (?)`
stmt, err := r.db.Prepare(query)
if err != nil {
return err
}