-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5439ae
commit bfc4094
Showing
10 changed files
with
82 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,8 @@ app: | |
host: 'localhost:8080' | ||
|
||
database: | ||
pool_max: 2 | ||
max_open_conns: 10 | ||
max_idle_conns: 10 | ||
|
||
api: | ||
port: 8080 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package constants | ||
|
||
const ( | ||
ErrMsgInvalidUsernameAndPassword = "Invalid request body. Please provide both username and password." | ||
ErrMsgUsernameOrPasswordRequired = "Username and password are required." | ||
ErrMsgUsernameNotFound = "Username not found." | ||
ErrMsgInvalidUsernameOrPassword = "Invalid username or password." | ||
|
||
ErrMsgInternalServerError = "Internal server error." | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package entity | ||
|
||
import "time" | ||
|
||
type CreateTokenResponse struct { | ||
Token string `json:"token"` | ||
TokenType string `json:"token_type"` | ||
ExpiredAt time.Time `json:"expired_at"` | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package ports | ||
|
||
import "github.com/voltgizerz/POS-restaurant/internal/app/entity" | ||
import ( | ||
"github.com/voltgizerz/POS-restaurant/internal/app/entity" | ||
) | ||
|
||
type IAuth interface { | ||
CreateToken(user *entity.User) (string, error) | ||
CreateToken(user *entity.User) (*entity.CreateTokenResponse, error) | ||
VerifyToken(tokenString string) error | ||
} |