Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit a95f3b0

Browse files
authored
Merge pull request #26 from ahdark-services/feat/services/system/email_queue
Multiple email sending methods
2 parents 8563802 + bcb93fb commit a95f3b0

File tree

34 files changed

+553
-483
lines changed

34 files changed

+553
-483
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Go
2121
uses: actions/setup-go@v3
2222
with:
23-
go-version: '1.20'
23+
go-version: '1.21'
2424

2525
- name: Cache Go build paths
2626
id: go-cache-paths

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Go
2626
uses: actions/setup-go@v3
2727
with:
28-
go-version: '1.20'
28+
go-version: '1.21'
2929

3030
- name: Cache Go build paths
3131
id: go-cache-paths

constant/amqp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ const (
1414
)
1515

1616
const (
17-
AMQPExchangeEmail = "email.exchange"
17+
AMQPExchangeEmail = "system_email.exchange"
1818
AMQPExchangePaymentNotification = "payment_notification.exchange"
1919
AMQPExchangeSystemBalance = "system_balance.exchange"
2020
AMQPExchangeSystemPayment = "system_payment.exchange"
2121
AMQPExchangeSystemValidate = "system_validate.exchange"
2222
)
2323

2424
const (
25-
AMQPExchangeEmailRoutingKeyStandardEmail = "email.standard"
25+
AMQPExchangeEmailRoutingKeyStandardEmail = "system_email.standard"
2626

2727
AMQPExchangePaymentNotificationRoutingKeyEPayPaymentNotification = "payment_notification.epay"
2828
AMQPExchangePaymentNotificationRoutingKeyOnerwayPaymentNotification = "payment_notification.oneway"

constant/metrics.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package constant
2+
3+
const (
4+
MetricsEmailQueueConsumed = "nextpayt_system_email_service_email_queue_consumed"
5+
)

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,12 +501,12 @@ services:
501501
- consul
502502
- mq
503503

504-
system-email-queue-service:
504+
system-email-service:
505505
build:
506506
context: .
507507
dockerfile: docker/all-in-one/Dockerfile
508508
command:
509-
- "/app/system/email_queue-service"
509+
- "/app/system/email-service"
510510
networks:
511511
- app-tier
512512
env_file:

docker/all-in-one/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20-alpine AS builder
1+
FROM golang:1.21-alpine AS builder
22
WORKDIR /app
33

44
# cache dependencies

docker/gateway/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20-buster AS builder
1+
FROM golang:1.21-buster AS builder
22
WORKDIR /app
33

44
# cache dependencies

docker/migrator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20-buster AS builder
1+
FROM golang:1.21-buster AS builder
22
WORKDIR /app
33

44
# cache dependencies

docker/service/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20-buster AS builder
1+
FROM golang:1.21-buster AS builder
22
WORKDIR /app
33

44
# cache dependencies

go.mod

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
module github.com/ahdark-services/nextpayt
22

3-
go 1.20
3+
go 1.21
44

55
require (
66
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.19.1
77
github.com/cloudwego/fastpb v0.0.4
88
github.com/cloudwego/hertz v0.6.8
99
github.com/cloudwego/kitex v0.7.1
10-
github.com/go-playground/validator/v10 v10.15.3
10+
github.com/dgraph-io/ristretto v0.1.1
11+
github.com/go-playground/validator/v10 v10.15.4
1112
github.com/go-redis/redis_rate/v10 v10.0.1
1213
github.com/go-redis/redismock/v9 v9.0.3
1314
github.com/golang-jwt/jwt/v5 v5.0.0
@@ -18,13 +19,13 @@ require (
1819
github.com/hertz-contrib/logger/logrus v1.0.0
1920
github.com/hertz-contrib/monitor-prometheus v0.0.0-20221109015426-47eab4e08245
2021
github.com/hertz-contrib/obs-opentelemetry/tracing v0.2.2
21-
github.com/hertz-contrib/registry/consul v0.0.0-20230731080040-f474f58b3da2
22+
github.com/hertz-contrib/registry/consul v0.0.0-20230911090520-bdf77d97b503
2223
github.com/imroc/req/v3 v3.42.0
2324
github.com/joho/godotenv v1.5.1
2425
github.com/kelseyhightower/envconfig v1.4.0
2526
github.com/kitex-contrib/obs-opentelemetry v0.2.3
2627
github.com/kitex-contrib/registry-consul v0.0.0-20230406075225-7d341f036654
27-
github.com/mileusna/useragent v1.3.3
28+
github.com/mileusna/useragent v1.3.4
2829
github.com/mitchellh/mapstructure v1.5.0
2930
github.com/onrik/gorm-logrus v0.5.0
3031
github.com/prometheus/client_golang v1.16.0
@@ -43,9 +44,10 @@ require (
4344
go.etcd.io/etcd/api/v3 v3.5.9
4445
go.etcd.io/etcd/client/v3 v3.5.9
4546
go.opentelemetry.io/otel v1.18.0
46-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.17.0
47+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.18.0
4748
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.18.0
4849
go.opentelemetry.io/otel/exporters/prometheus v0.41.0
50+
go.opentelemetry.io/otel/metric v1.18.0
4951
go.opentelemetry.io/otel/sdk v1.18.0
5052
go.opentelemetry.io/otel/sdk/metric v0.41.0
5153
go.opentelemetry.io/otel/trace v1.18.0
@@ -68,13 +70,13 @@ require (
6870
github.com/andeya/ameda v1.5.3 // indirect
6971
github.com/andeya/goutil v1.0.1 // indirect
7072
github.com/andybalholm/brotli v1.0.5 // indirect
71-
github.com/apache/thrift v0.18.1 // indirect
73+
github.com/apache/thrift v0.19.0 // indirect
7274
github.com/armon/go-metrics v0.4.1 // indirect
7375
github.com/beorn7/perks v1.0.1 // indirect
74-
github.com/bufbuild/protocompile v0.4.0 // indirect
76+
github.com/bufbuild/protocompile v0.6.0 // indirect
7577
github.com/bytedance/go-tagexpr/v2 v2.9.9 // indirect
7678
github.com/bytedance/gopkg v0.0.0-20230728082804-614d0af6619b // indirect
77-
github.com/bytedance/sonic v1.10.0 // indirect
79+
github.com/bytedance/sonic v1.10.1 // indirect
7880
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
7981
github.com/cespare/xxhash/v2 v2.2.0 // indirect
8082
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
@@ -83,14 +85,15 @@ require (
8385
github.com/cloudflare/circl v1.3.3 // indirect
8486
github.com/cloudwego/configmanager v0.2.0 // indirect
8587
github.com/cloudwego/dynamicgo v0.1.3 // indirect
86-
github.com/cloudwego/frugal v0.1.7 // indirect
88+
github.com/cloudwego/frugal v0.1.8 // indirect
8789
github.com/cloudwego/localsession v0.0.2 // indirect
8890
github.com/cloudwego/netpoll v0.4.1 // indirect
89-
github.com/cloudwego/thriftgo v0.3.0 // indirect
91+
github.com/cloudwego/thriftgo v0.3.1 // indirect
9092
github.com/coreos/go-semver v0.3.1 // indirect
9193
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
9294
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
9395
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
96+
github.com/dustin/go-humanize v1.0.1 // indirect
9497
github.com/fatih/color v1.15.0 // indirect
9598
github.com/fatih/structtag v1.2.0 // indirect
9699
github.com/fsnotify/fsnotify v1.6.0 // indirect
@@ -103,15 +106,16 @@ require (
103106
github.com/go-sql-driver/mysql v1.7.1 // indirect
104107
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
105108
github.com/gogo/protobuf v1.3.2 // indirect
109+
github.com/golang/glog v1.1.2 // indirect
106110
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
107111
github.com/golang/mock v1.6.0 // indirect
108112
github.com/golang/protobuf v1.5.3 // indirect
109113
github.com/google/go-cmp v0.5.9 // indirect
110-
github.com/google/pprof v0.0.0-20230901174712-0191c66da455 // indirect
111-
github.com/google/s2a-go v0.1.4 // indirect
114+
github.com/google/pprof v0.0.0-20230912144702-c363fe2c2ed8 // indirect
115+
github.com/google/s2a-go v0.1.7 // indirect
112116
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
113117
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
114-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.17.1 // indirect
118+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect
115119
github.com/hashicorp/errwrap v1.1.0 // indirect
116120
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
117121
github.com/hashicorp/go-hclog v1.5.0 // indirect
@@ -120,11 +124,11 @@ require (
120124
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
121125
github.com/hashicorp/golang-lru v1.0.2 // indirect
122126
github.com/hashicorp/serf v0.10.1 // indirect
123-
github.com/iancoleman/strcase v0.2.0 // indirect
127+
github.com/iancoleman/strcase v0.3.0 // indirect
124128
github.com/jackc/pgpassfile v1.0.0 // indirect
125129
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
126130
github.com/jackc/pgx/v5 v5.4.3 // indirect
127-
github.com/jhump/protoreflect v1.15.1 // indirect
131+
github.com/jhump/protoreflect v1.15.2 // indirect
128132
github.com/jinzhu/inflection v1.0.0 // indirect
129133
github.com/jinzhu/now v1.1.5 // indirect
130134
github.com/json-iterator/go v1.1.12 // indirect
@@ -141,16 +145,17 @@ require (
141145
github.com/nyaruka/phonenumbers v1.1.8 // indirect
142146
github.com/oleiade/lane v1.0.1 // indirect
143147
github.com/onsi/ginkgo/v2 v2.12.0 // indirect
148+
github.com/pkg/errors v0.9.1 // indirect
144149
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
145150
github.com/prometheus/client_model v0.4.0 // indirect
146151
github.com/prometheus/common v0.44.0 // indirect
147152
github.com/prometheus/procfs v0.11.1 // indirect
148153
github.com/quic-go/qpack v0.4.0 // indirect
149-
github.com/quic-go/qtls-go1-20 v0.3.3 // indirect
154+
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
150155
github.com/quic-go/quic-go v0.38.1 // indirect
151156
github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect
152157
github.com/refraction-networking/utls v1.5.3 // indirect
153-
github.com/tidwall/gjson v1.15.0 // indirect
158+
github.com/tidwall/gjson v1.16.0 // indirect
154159
github.com/tidwall/match v1.1.1 // indirect
155160
github.com/tidwall/pretty v1.2.1 // indirect
156161
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
@@ -159,27 +164,26 @@ require (
159164
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
160165
go.opencensus.io v0.24.0 // indirect
161166
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.18.0 // indirect
162-
go.opentelemetry.io/otel/metric v1.18.0 // indirect
163167
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
164168
go.uber.org/atomic v1.11.0 // indirect
165169
go.uber.org/dig v1.17.0 // indirect
166170
go.uber.org/multierr v1.11.0 // indirect
167-
go.uber.org/zap v1.25.0 // indirect
171+
go.uber.org/zap v1.26.0 // indirect
168172
golang.org/x/arch v0.5.0 // indirect
169-
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
173+
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
170174
golang.org/x/mod v0.12.0 // indirect
171175
golang.org/x/net v0.15.0 // indirect
172-
golang.org/x/oauth2 v0.11.0 // indirect
176+
golang.org/x/oauth2 v0.12.0 // indirect
173177
golang.org/x/sync v0.3.0 // indirect
174178
golang.org/x/sys v0.12.0 // indirect
175179
golang.org/x/text v0.13.0 // indirect
176-
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect
177-
google.golang.org/api v0.135.0 // indirect
178-
google.golang.org/appengine v1.6.7 // indirect
180+
golang.org/x/tools v0.13.0 // indirect
181+
google.golang.org/api v0.141.0 // indirect
182+
google.golang.org/appengine v1.6.8 // indirect
179183
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
180184
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
181185
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect
182-
google.golang.org/grpc v1.58.0 // indirect
186+
google.golang.org/grpc v1.58.1 // indirect
183187
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
184188
gopkg.in/yaml.v3 v3.0.1 // indirect
185189
gorm.io/datatypes v1.2.0 // indirect

0 commit comments

Comments
 (0)