Skip to content

Commit

Permalink
chore: update libraries and some other improvement (please see the ch…
Browse files Browse the repository at this point in the history
…angelog)
  • Loading branch information
auliawiguna committed Nov 12, 2024
1 parent b0ed9b3 commit 1a4da5a
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 29 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
AWS_BUCKET=

REDIS_ACTIVATE=false
REDIS_HOST=goshaka_redis:6379
REDIS_PASSWORD=
REDIS_DB=0
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.1.4] - 2024-11-12

### Fixed
- Only publish the Swagger documentation in the dev environment

### Improvement
- Use the official Fiber Swag library
- Update libraries
- Add an option to not use Redis

## [0.1.3] - 2023-03-13
First Release
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# If we use GVM, GOPATH is "/home/{USERNAME}/go/bin/swag"

build:
go build -o server -gcflags=all=-l -ldflags="-w -s" main.go

Expand Down
3 changes: 2 additions & 1 deletion app/routes/api/v1/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package v1
import (
_ "goshaka/docs"

swagger "github.com/arsmn/fiber-swagger/v2"
swagger "github.com/gofiber/swagger"

"github.com/gofiber/fiber/v2"
)

Expand Down
7 changes: 6 additions & 1 deletion app/routes/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package routes
import (
routeV1 "goshaka/app/routes/api/v1"

appConfig "goshaka/configs"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
)
Expand Down Expand Up @@ -39,5 +41,8 @@ func ApiRoutes(app *fiber.App) {
routeV1.PermissionRoute(apiV1)
routeV1.UserRoute(apiV1)
routeV1.FilesRoute(apiV1)
routeV1.SwaggerRoute(apiV1)

if appConfig.GetEnv("ENV") == "dev" {
routeV1.SwaggerRoute(apiV1)
}
}
5 changes: 3 additions & 2 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Code generated by swaggo/swag. DO NOT EDIT.

// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs

import "github.com/swaggo/swag"
Expand Down Expand Up @@ -1723,6 +1722,8 @@ var SwaggerInfo = &swag.Spec{
Description: "This is an API boilerplate using Golang",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {
Expand Down
47 changes: 25 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
module goshaka

go 1.19
go 1.23.2

require (
github.com/arsmn/fiber-swagger/v2 v2.31.1
github.com/auliawiguna/goshaka-stringhelper v0.1.3
github.com/aws/aws-sdk-go v1.44.195
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/go-co-op/gocron v1.18.0
github.com/go-playground/validator/v10 v10.11.1
github.com/goccy/go-json v0.10.0
github.com/gofiber/fiber/v2 v2.41.0
github.com/gofiber/fiber/v2 v2.52.5
github.com/joho/godotenv v1.4.0
github.com/microcosm-cc/bluemonday v1.0.21
github.com/redis/go-redis/v9 v9.0.2
github.com/stretchr/testify v1.8.1
github.com/swaggo/swag v1.8.9
golang.org/x/crypto v0.5.0
github.com/stretchr/testify v1.9.0
github.com/swaggo/swag v1.16.4
golang.org/x/crypto v0.29.0
google.golang.org/api v0.109.0
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gorm.io/driver/mysql v1.4.4
Expand All @@ -28,21 +27,22 @@ require (
cloud.google.com/go/compute v1.14.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/spec v0.20.7 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-sql-driver/mysql v1.7.0 // indirect
github.com/gofiber/swagger v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.1 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
Expand All @@ -57,28 +57,31 @@ require (
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.15.14 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/swaggo/files v1.0.0 // indirect
github.com/swaggo/files/v2 v2.0.1 // indirect
github.com/tinylib/msgp v1.1.8 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.43.0 // indirect
github.com/valyala/fasthttp v1.57.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.5.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/tools v0.27.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect
google.golang.org/grpc v1.51.0 // indirect
Expand Down
Loading

0 comments on commit 1a4da5a

Please sign in to comment.