Skip to content

Commit 0e8999b

Browse files
refactor: rename vars
1 parent 44101c8 commit 0e8999b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

internal/endpoints/endpoints.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (pe ParsedEndpoint) Send(cc core.Context, env envelope.Envelope) error {
103103
return err
104104
}
105105

106-
log.Info().Int64("envelope_id", env.Message.ID).Int64("endpoint_id", pe.ID).Msg("Envelope sent to endpoint")
106+
log.Info().Int64("envelope-id", env.Message.ID).Int64("endpoint-id", pe.ID).Msg("Envelope sent to endpoint")
107107

108108
return nil
109109
}

internal/procs/endpoint.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import (
99
"github.com/ItsNotGoodName/smtpbridge/internal/envelope"
1010
)
1111

12-
func EndpointSend(cc core.Context, envelope_id int64, endpoint_id int64) error {
13-
end, err := db.EndpointGet(cc, endpoint_id)
12+
func EndpointSend(cc core.Context, envelopeID int64, endpointID int64) error {
13+
end, err := db.EndpointGet(cc, endpointID)
1414
if err != nil {
1515
return err
1616
}
1717

18-
env, err := db.EnvelopeGet(cc, envelope_id)
18+
env, err := db.EnvelopeGet(cc, envelopeID)
1919
if err != nil {
2020
return err
2121
}

internal/procs/mailman.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func mailman(cc core.Context, evtC <-chan core.EventEnvelopeCreated) {
9090

9191
// Send envelope to endpoint
9292
if err := parsedEndpoint.Send(cc, env); err != nil {
93-
log.Err(err).Int64("envelope_id", env.Message.ID).Int64("endpoint_id", end.ID).Msg("Failed to send envelope to endpoint")
93+
log.Err(err).Int64("envelope-id", env.Message.ID).Int64("endpoint-id", end.ID).Msg("Failed to send envelope to endpoint")
9494
}
9595
}
9696
}

web/controllers/controllers.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ func Files(app core.App) fiber.Handler {
7171

7272
func Send(c *fiber.Ctx, cc core.Context) error {
7373
// Request
74-
envelope_id, err := strconv.ParseInt(c.FormValue("envelope"), 10, 64)
74+
envelopeID, err := strconv.ParseInt(c.FormValue("envelope"), 10, 64)
7575
if err != nil {
7676
return helpers.Error(c, err, http.StatusBadRequest)
7777
}
78-
endpoint_id, err := strconv.ParseInt(c.FormValue("endpoint"), 10, 64)
78+
endpointID, err := strconv.ParseInt(c.FormValue("endpoint"), 10, 64)
7979
if err != nil {
8080
return helpers.Error(c, err, http.StatusBadRequest)
8181
}
8282

8383
// Execute
84-
err = procs.EndpointSend(cc, envelope_id, endpoint_id)
84+
err = procs.EndpointSend(cc, envelopeID, endpointID)
8585
if err != nil {
8686
return helpers.Error(c, err)
8787
}

0 commit comments

Comments
 (0)