forked from bxcodec/go-clean-arch
-
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.
feat: Introduce domain package (bxcodec#21)
* init * refactor: move everything to domain * add app * remove unnecessar-things * fix makefile * ref: grouping the implementations in the same package * chore(code-style): change the code styles * chore: re-organize the middleware * chore: add readme explanation * chore: update Readme styling * chore: add URL on link in readme
- Loading branch information
Showing
28 changed files
with
370 additions
and
418 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 |
---|---|---|
|
@@ -23,4 +23,4 @@ EXPOSE 9090 | |
|
||
COPY --from=builder /app/engine /app | ||
|
||
CMD /app/engine | ||
CMD /app/engine |
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
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 was deleted.
Oops, something went wrong.
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,30 @@ | ||
package repository | ||
|
||
import ( | ||
"encoding/base64" | ||
"time" | ||
) | ||
|
||
const ( | ||
timeFormat = "2006-01-02T15:04:05.999Z07:00" // reduce precision from RFC3339Nano as date format | ||
) | ||
|
||
// DecodeCursor will decode cursor from user for mysql | ||
func DecodeCursor(encodedTime string) (time.Time, error) { | ||
byt, err := base64.StdEncoding.DecodeString(encodedTime) | ||
if err != nil { | ||
return time.Time{}, err | ||
} | ||
|
||
timeString := string(byt) | ||
t, err := time.Parse(timeFormat, timeString) | ||
|
||
return t, err | ||
} | ||
|
||
// EncodeCursor will encode cursor from mysql to user | ||
func EncodeCursor(t time.Time) string { | ||
timeString := t.Format(timeFormat) | ||
|
||
return base64.StdEncoding.EncodeToString([]byte(timeString)) | ||
} |
Oops, something went wrong.