This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // "SPDX-License-Identifier: UNLICENSED" | |
| pragma solidity ^0.8.1; | |
| import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol"; | |
| contract Allowance is Ownable { | |
| // using SafeMath for uint; | |
| event AllowanceChanged(address indexed _forWho, address indexed _byWhom, uint _oldAmount, uint _newAmount); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package handler | |
| import ( | |
| "log" | |
| "net/http" | |
| "github.com/gin-gonic/gin" | |
| "github.com/jacobsngoodwin/memrizr/account/model" | |
| "github.com/jacobsngoodwin/memrizr/account/model/apperrors" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package repositories | |
| import ( | |
| "database/sql" | |
| "regexp" | |
| "testing" | |
| "github.com/jinzhu/gorm" | |
| "github.com/krittawatcode/go-todo-clean-arch/domains" | |
| "github.com/krittawatcode/go-todo-clean-arch/models" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| _ "github.com/go-sql-driver/mysql" | |
| "github.com/jinzhu/gorm" | |
| "github.com/krittawatcode/go-todo-clean-arch/databases" | |
| "github.com/krittawatcode/go-todo-clean-arch/deliveries/routes" | |
| "github.com/krittawatcode/go-todo-clean-arch/models" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package database | |
| import ( | |
| "fmt" | |
| "os" | |
| "github.com/jinzhu/gorm" | |
| ) | |
| // DB is a global var for connect DB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package routes | |
| import ( | |
| "github.com/gin-gonic/gin" | |
| "github.com/krittawatcode/go-todo-clean-arch/databases" | |
| "github.com/krittawatcode/go-todo-clean-arch/deliveries" | |
| "github.com/krittawatcode/go-todo-clean-arch/repositories" | |
| "github.com/krittawatcode/go-todo-clean-arch/usecases" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package deliveries | |
| import ( | |
| "net/http" | |
| "github.com/gin-gonic/gin" | |
| "github.com/krittawatcode/go-todo-clean-arch/domains" | |
| "github.com/krittawatcode/go-todo-clean-arch/models" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package usecases | |
| import ( | |
| "github.com/krittawatcode/go-todo-clean-arch/domains" | |
| "github.com/krittawatcode/go-todo-clean-arch/models" | |
| ) | |
| // UseCase don't give a shit about the world!! | |
| type todoUseCase struct { | |
| todoRepo domains.ToDoRepository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package repositories | |
| import ( | |
| _ "github.com/go-sql-driver/mysql" // use to connect db | |
| "github.com/jinzhu/gorm" | |
| "github.com/krittawatcode/go-todo-clean-arch/domains" | |
| "github.com/krittawatcode/go-todo-clean-arch/models" | |
| ) | |
| type todoRepository struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package domains | |
| import ( | |
| "github.com/krittawatcode/go-todo-clean-arch/models" | |
| ) | |
| // ToDoUseCase ... | |
| type ToDoUseCase interface { | |
| GetAllToDos() (t []models.Todo, err error) | |
| CreateATodo(t *models.Todo) (err error) |
NewerOlder