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 service | |
| type LoginService interface { | |
| LoginUser(email string, password string) bool | |
| } | |
| type loginInformation struct { | |
| email string | |
| password string | |
| } |
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 service | |
| import ( | |
| "fmt" | |
| "os" | |
| "time" | |
| "github.com/dgrijalva/jwt-go" | |
| ) |
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 dto | |
| //Login credential | |
| type LoginCredentials struct { | |
| Email string `form:"email"` | |
| Password string `form:"password"` | |
| } |
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 controller | |
| import ( | |
| "github/krittawatcode/go-jwt/src/dto" | |
| "github/krittawatcode/go-jwt/src/service" | |
| "github.com/gin-gonic/gin" | |
| ) | |
| //login contorller interface |
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 ( | |
| "github/krittawatcode/go-jwt/src/controller" | |
| "github/krittawatcode/go-jwt/src/middleware" | |
| "github/krittawatcode/go-jwt/src/service" | |
| "net/http" | |
| "github.com/gin-gonic/gin" | |
| ) |
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 middleware | |
| import ( | |
| "fmt" | |
| "github/krittawatcode/go-jwt/src/service" | |
| "net/http" | |
| "github.com/dgrijalva/jwt-go" | |
| "github.com/gin-gonic/gin" | |
| ) |
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 controller | |
| import ( | |
| "strconv" | |
| "github.com/gin-gonic/gin" | |
| "github.com/krittawatcode/go-soldier-mvc/service" | |
| ) | |
| type SoldierController interface { |
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 service | |
| import ( | |
| "net/http" | |
| "github.com/gin-gonic/gin" | |
| "github.com/krittawatcode/go-soldier-mvc/cores" | |
| ) | |
| // DutyService for define all service |
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 cores | |
| type Solider struct { | |
| Rank string `json:"rank"` | |
| Wife int `json:"wife"` | |
| Salary int `json:"salary"` | |
| Home bool `json:"home"` | |
| Car bool `json:"car"` | |
| Corruption bool `json:"corruption"` | |
| } |
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 ( | |
| "github.com/gin-gonic/gin" | |
| "github.com/krittawatcode/go-soldier-mvc/controller" | |
| "github.com/krittawatcode/go-soldier-mvc/service" | |
| ) | |
| func main() { | |
| server := gin.Default() |
OlderNewer