Skip to content

Commit

Permalink
Merge branch 'master' into bowen/#280-25
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbrzzl authored Nov 30, 2024
2 parents 04de683 + 65c6a08 commit b2496c3
Show file tree
Hide file tree
Showing 24 changed files with 170 additions and 59 deletions.
6 changes: 4 additions & 2 deletions auth/service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import (
"github.com/goravel/framework/errors"
)

const BindingAuth = "goravel.auth"
const BindingGate = "goravel.gate"
const (
BindingAuth = "goravel.auth"
BindingGate = "goravel.gate"
)

type ServiceProvider struct {
}
Expand Down
24 changes: 13 additions & 11 deletions contracts/database/orm/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ import (

type EventType string

const EventRetrieved EventType = "retrieved"
const EventCreating EventType = "creating"
const EventCreated EventType = "created"
const EventUpdating EventType = "updating"
const EventUpdated EventType = "Updated"
const EventSaving EventType = "saving"
const EventSaved EventType = "saved"
const EventDeleting EventType = "deleting"
const EventDeleted EventType = "deleted"
const EventForceDeleting EventType = "force_deleting"
const EventForceDeleted EventType = "force_deleted"
const (
EventRetrieved EventType = "retrieved"
EventCreating EventType = "creating"
EventCreated EventType = "created"
EventUpdating EventType = "updating"
EventUpdated EventType = "Updated"
EventSaving EventType = "saving"
EventSaved EventType = "saved"
EventDeleting EventType = "deleting"
EventDeleted EventType = "deleted"
EventForceDeleting EventType = "force_deleting"
EventForceDeleted EventType = "force_deleted"
)

type Event interface {
// Context returns the event context.
Expand Down
2 changes: 2 additions & 0 deletions contracts/http/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import (
)

type Middleware func(Context)

type HandlerFunc func(Context) Response

type ResourceController interface {
// Index method for controller
Index(Context) Response
Expand Down
2 changes: 2 additions & 0 deletions database/gorm/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type TestEventModel struct {
}

var testNow = time.Now().Add(-1 * time.Second)

var testEventModel = TestEventModel{
Model: Model{
ID: 1,
Expand All @@ -38,6 +39,7 @@ var testEventModel = TestEventModel{
ManageAt: testNow,
high: 1,
}

var testQuery = &Query{
instance: &gorm.DB{
Statement: &gorm.Statement{
Expand Down
3 changes: 2 additions & 1 deletion database/schema/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package schema
import (
"testing"

"github.com/goravel/framework/errors"
"github.com/stretchr/testify/assert"

"github.com/goravel/framework/errors"
)

func TestParseSchemaAndTable(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions filesystem/service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import (

const Binding = "goravel.filesystem"

var ConfigFacade configcontract.Config
var StorageFacade filesystemcontract.Storage
var (
ConfigFacade configcontract.Config
StorageFacade filesystemcontract.Storage
)

type ServiceProvider struct {
}
Expand Down
1 change: 1 addition & 0 deletions foundation/console/vendor_publish_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ func (receiver *VendorPublishCommand) getSourceFilesForDir(sourcePath string) ([

return sourceFiles, nil
}

func (receiver *VendorPublishCommand) publishFile(sourceFile, targetFile string, existing, force bool) (bool, error) {
content, err := os.ReadFile(sourceFile)
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ require (
github.com/RichardKnop/machinery/v2 v2.0.13
github.com/brianvoe/gofakeit/v7 v7.1.2
github.com/charmbracelet/huh v0.6.0
github.com/charmbracelet/huh/spinner v0.0.0-20241119235641-e7e76ffbce9f
github.com/charmbracelet/huh/spinner v0.0.0-20241127125741-aad810dfbce6
github.com/charmbracelet/lipgloss v1.0.0
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/dromara/carbon/v2 v2.5.1
github.com/gabriel-vasile/mimetype v1.4.7
github.com/glebarez/go-sqlite v1.22.0
github.com/glebarez/sqlite v1.11.0
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/golang-migrate/migrate/v4 v4.18.1
github.com/golang-module/carbon/v2 v2.4.1
github.com/golang/protobuf v1.5.4
github.com/google/uuid v1.6.0
github.com/gookit/validate v1.5.2
github.com/goravel/file-rotatelogs/v2 v2.4.2
github.com/hashicorp/go-multierror v1.1.1
github.com/pterm/pterm v0.12.79
github.com/pterm/pterm v0.12.80
github.com/redis/go-redis/v9 v9.7.0
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
github.com/robfig/cron/v3 v3.0.1
Expand All @@ -31,7 +31,7 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cast v1.7.0
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
github.com/urfave/cli/v2 v2.27.5
go.uber.org/atomic v1.11.0
golang.org/x/crypto v0.29.0
Expand Down Expand Up @@ -82,7 +82,7 @@ require (
github.com/go-redsync/redsync/v4 v4.8.1 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand Down
19 changes: 10 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ github.com/charmbracelet/bubbletea v1.2.3 h1:d9MdMsANIYZB5pE1KkRqaUV6GfsiWm+/9z4
github.com/charmbracelet/bubbletea v1.2.3/go.mod h1:Qr6fVQw+wX7JkWWkVyXYk/ZUQ92a6XNekLXa3rR18MM=
github.com/charmbracelet/huh v0.6.0 h1:mZM8VvZGuE0hoDXq6XLxRtgfWyTI3b2jZNKh0xWmax8=
github.com/charmbracelet/huh v0.6.0/go.mod h1:GGNKeWCeNzKpEOh/OJD8WBwTQjV3prFAtQPpLv+AVwU=
github.com/charmbracelet/huh/spinner v0.0.0-20241119235641-e7e76ffbce9f h1:ZTsY2rOyry0z683EoWqecJvvxibhaMSlceTMvMNyp/A=
github.com/charmbracelet/huh/spinner v0.0.0-20241119235641-e7e76ffbce9f/go.mod h1:3/xTBdgqRzAb+eUKRAGi9ix/K6QxsS0nGtd4zp+/tJs=
github.com/charmbracelet/huh/spinner v0.0.0-20241127125741-aad810dfbce6 h1:btKBXcuvUcXRT0VVk850BOpov6wjCLAPoJuaPm+sCKU=
github.com/charmbracelet/huh/spinner v0.0.0-20241127125741-aad810dfbce6/go.mod h1:3/xTBdgqRzAb+eUKRAGi9ix/K6QxsS0nGtd4zp+/tJs=
github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg=
github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo=
github.com/charmbracelet/x/ansi v0.4.5 h1:LqK4vwBNaXw2AyGIICa5/29Sbdq58GbGdFngSexTdRM=
Expand Down Expand Up @@ -179,6 +179,8 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dromara/carbon/v2 v2.5.1 h1:hn03OvNBFvMW24McEB5rEyFpJ0nLO6yYHbRfQ9gJ3G8=
github.com/dromara/carbon/v2 v2.5.1/go.mod h1:zyPlND2o27sKKkRmdgLbk/qYxkmmH6Z4eE8OoM0w3DM=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down Expand Up @@ -254,16 +256,14 @@ github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY9
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=
github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang-migrate/migrate/v4 v4.18.1 h1:JML/k+t4tpHCpQTCAD62Nu43NUFzHY4CV3uAuvHGC+Y=
github.com/golang-migrate/migrate/v4 v4.18.1/go.mod h1:HAX6m3sQgcdO81tdjn5exv20+3Kb13cmGli1hrD6hks=
github.com/golang-module/carbon/v2 v2.4.1 h1:cYUD8T+rHeX+qIybGYpnJ8I90F10dvyEF67VNOO+zZM=
github.com/golang-module/carbon/v2 v2.4.1/go.mod h1:1jP9AZ4k2+lmfgY/wZgmtsN52VcHC5YuPM6varKDTkM=
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA=
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
Expand Down Expand Up @@ -508,8 +508,8 @@ github.com/pterm/pterm v0.12.31/go.mod h1:32ZAWZVXD7ZfG0s8qqHXePte42kdz8ECtRyEej
github.com/pterm/pterm v0.12.33/go.mod h1:x+h2uL+n7CP/rel9+bImHD5lF3nM9vJj80k9ybiiTTE=
github.com/pterm/pterm v0.12.36/go.mod h1:NjiL09hFhT/vWjQHSj1athJpx6H8cjpHXNAK5bUw8T8=
github.com/pterm/pterm v0.12.40/go.mod h1:ffwPLwlbXxP+rxT0GsgDTzS3y3rmpAO1NMjUkGTYf8s=
github.com/pterm/pterm v0.12.79 h1:lH3yrYMhdpeqX9y5Ep1u7DejyHy7NSQg9qrBjF9dFT4=
github.com/pterm/pterm v0.12.79/go.mod h1:1v/gzOF1N0FsjbgTHZ1wVycRkKiatFvJSJC4IGaQAAo=
github.com/pterm/pterm v0.12.80 h1:mM55B+GnKUnLMUSqhdINe4s6tOuVQIetQ3my8JGyAIg=
github.com/pterm/pterm v0.12.80/go.mod h1:c6DeF9bSnOSeFPZlfs4ZRAFcf5SCoTwvwQ5xaKGQlHo=
github.com/rabbitmq/amqp091-go v1.9.0 h1:qrQtyzB4H8BQgEuJwhmVQqVHB9O4+MNDJCCAcpc3Aoo=
github.com/rabbitmq/amqp091-go v1.9.0/go.mod h1:+jPrT9iY2eLjRaMSRHUhc3z14E/l85kv/f+6luSD3pc=
github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps=
Expand Down Expand Up @@ -577,8 +577,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203 h1:QVqDTf3h2WHt08YuiTGPZLls0Wq99X9bWd0Q5ZSBesM=
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
Expand Down
6 changes: 4 additions & 2 deletions grpc/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import (

type contextKey int

const server contextKey = 0
const client contextKey = 1
const (
server contextKey = 0
client contextKey = 1
)

func TestRun(t *testing.T) {
var (
Expand Down
6 changes: 4 additions & 2 deletions http/service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import (
"github.com/goravel/framework/http/console"
)

const BindingRateLimiter = "goravel.rate_limiter"
const BindingView = "goravel.view"
const (
BindingRateLimiter = "goravel.rate_limiter"
BindingView = "goravel.view"
)

type ServiceProvider struct{}

Expand Down
15 changes: 14 additions & 1 deletion log/formatter/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,26 @@ func (general *General) formatStackTraces(stackTraces any) (string, error) {
root := traces.Root
if len(root.Stack) > 0 {
for _, stackStr := range root.Stack {
formattedTraces.WriteString(fmt.Sprintf("\t%s\n", stackStr))
formattedTraces.WriteString(formatStackTrace(stackStr))
}
}

return formattedTraces.String(), nil
}

func formatStackTrace(stackStr string) string {
lastColon := strings.LastIndex(stackStr, ":")
if lastColon > 0 && lastColon < len(stackStr)-1 {
secondLastColon := strings.LastIndex(stackStr[:lastColon], ":")
if secondLastColon > 0 {
fileLine := stackStr[secondLastColon+1:]
method := stackStr[:secondLastColon]
return fmt.Sprintf("\t%s [%s]\n", fileLine, method)
}
}
return fmt.Sprintf("\t%s\n", stackStr)
}

func deleteKey(data logrus.Fields, keyToDelete string) logrus.Fields {
dataCopy := make(logrus.Fields)
for key, value := range data {
Expand Down
81 changes: 71 additions & 10 deletions log/formatter/general_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,16 @@ func (s *GeneralTestSuite) TestFormatStackTraces() {
"root": map[string]any{
"message": "error bad request", // root cause
"stack": []string{
"main.main:/dummy/examples/logging/example.go:143", // original calling method
"main.ProcessResource:/dummy/examples/logging/example.go:71",
"main.(*Request).Validate:/dummy/examples/logging/example.go:29", // location of Wrap call
"main.(*Request).Validate:/dummy/examples/logging/example.go:28", // location of the root
"/dummy/examples/logging/example.go:143 [main.main]", // original calling method
"/dummy/examples/logging/example.go:71 [main.ProcessResource]",
"/dummy/examples/logging/example.go:29 [main.(*Request).Validate]", // location of Wrap call
"/dummy/examples/logging/example.go:28 [main.(*Request).Validate]", // location of the root
},
},
"wrap": []map[string]any{
{
"message": "received a request with no ID", // additional context
"stack": "main.(*Request).Validate:/dummy/examples/logging/example.go:29", // location of Wrap call
"message": "received a request with no ID", // additional context
"stack": "/dummy/examples/logging/example.go:29 [main.(*Request).Validate]", // location of Wrap call
},
},
}
Expand All @@ -218,10 +218,10 @@ func (s *GeneralTestSuite) TestFormatStackTraces() {
traces, err := general.formatStackTraces(stackTraces)
s.Nil(err)
stackTraces := []string{
"main.main:/dummy/examples/logging/example.go:143",
"main.ProcessResource:/dummy/examples/logging/example.go:71",
"main.(*Request).Validate:/dummy/examples/logging/example.go:29",
"main.(*Request).Validate:/dummy/examples/logging/example.go:28",
"/dummy/examples/logging/example.go:143 [main.main]",
"/dummy/examples/logging/example.go:71 [main.ProcessResource]",
"/dummy/examples/logging/example.go:29 [main.(*Request).Validate]",
"/dummy/examples/logging/example.go:28 [main.(*Request).Validate]",
}
formattedStackTraces := "trace:\n\t" + strings.Join(stackTraces, "\n\t") + "\n"

Expand All @@ -238,6 +238,67 @@ func (s *GeneralTestSuite) TestFormatStackTraces() {
}
}

func TestFormatStackTrace(t *testing.T) {
tests := []struct {
name string
input string
expected string
}{
{
name: "Valid stack trace with file and method",
input: "main.functionName:/path/to/file.go:42",
expected: "\t/path/to/file.go:42 [main.functionName]\n",
},
{
name: "Valid stack trace without method",
input: "/path/to/file.go:42",
expected: "\t/path/to/file.go:42\n",
},
{
name: "No colons in stack trace",
input: "invalidstacktrace",
expected: "\tinvalidstacktrace\n",
},
{
name: "Single colon in stack trace",
input: "file.go:42",
expected: "\tfile.go:42\n",
},
{
name: "Edge case: Empty string",
input: "",
expected: "\t\n",
},
{
name: "Edge case: Colon at the end",
input: "file.go:",
expected: "\tfile.go:\n",
},
{
name: "Edge case: Colon at the beginning",
input: ":file.go",
expected: "\t:file.go\n",
},
{
name: "Edge case: Multiple colons with no method",
input: "/path/to/file.go:100:200",
expected: "\t100:200 [/path/to/file.go]\n",
},
{
name: "Valid stack trace with nested method and line",
input: "pkg.subpkg.functionName:/path/to/file.go:55",
expected: "\t/path/to/file.go:55 [pkg.subpkg.functionName]\n",
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := formatStackTrace(tt.input)
assert.Equal(t, tt.expected, result)
})
}
}

func TestDeleteKey(t *testing.T) {
tests := []struct {
name string
Expand Down
6 changes: 4 additions & 2 deletions log/logrus_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ import (
"github.com/goravel/framework/support/file"
)

var singleLog = "storage/logs/goravel.log"
var dailyLog = fmt.Sprintf("storage/logs/goravel-%s.log", carbon.Now().ToDateString())
var (
singleLog = "storage/logs/goravel.log"
dailyLog = fmt.Sprintf("storage/logs/goravel-%s.log", carbon.Now().ToDateString())
)

func TestLogrus(t *testing.T) {
var (
Expand Down
6 changes: 4 additions & 2 deletions queue/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import (
"github.com/goravel/framework/contracts/queue"
)

const DriverSync string = "sync"
const DriverRedis string = "redis"
const (
DriverSync string = "sync"
DriverRedis string = "redis"
)

type Worker struct {
concurrent int
Expand Down
Loading

0 comments on commit b2496c3

Please sign in to comment.