Compare commits

..

6 Commits

Author SHA1 Message Date
王性驊 93c491387a fix: package name 2025-03-08 11:01:44 +08:00
王性驊 98a9ef6c0a fix: package name 2025-03-08 10:49:33 +08:00
王性驊 dee9da8ffe feat: add template 2025-03-01 23:21:55 +08:00
王性驊 727f949f50 feat: add template 2025-03-01 23:15:32 +08:00
王性驊 2921bc9869 chore: golint 2025-03-01 22:19:06 +08:00
王性驊 54cc84c5b6 feat: add send mail 2025-03-01 22:10:00 +08:00
6 changed files with 1 additions and 69 deletions

View File

@ -7,7 +7,7 @@ package senderservice
import ( import (
"context" "context"
"app-cloudep-notification-service/gen_result/pb/notification" "code.30cm.net/digimon/app-cloudep-notification-service/gen_result/pb/notification"
"github.com/zeromicro/go-zero/zrpc" "github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc" "google.golang.org/grpc"

View File

@ -32,13 +32,3 @@ MitakeSMSSender:
User: xxxxxx User: xxxxxx
Password : xxxxxx Password : xxxxxx
DevServer:
Enabled: false
Port: 6470
MetricsPath: /metrics
EnableMetrics: true
PyroScope:
Enable: false
URL: http://10.0.0.13:4040
Token: "xxx"

3
go.mod
View File

@ -8,7 +8,6 @@ require (
github.com/aws/aws-sdk-go-v2 v1.36.3 github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2/credentials v1.17.61 github.com/aws/aws-sdk-go-v2/credentials v1.17.61
github.com/aws/aws-sdk-go-v2/service/ses v1.30.0 github.com/aws/aws-sdk-go-v2/service/ses v1.30.0
github.com/grafana/pyroscope-go v1.2.0
github.com/matcornic/hermes/v2 v2.1.0 github.com/matcornic/hermes/v2 v2.1.0
github.com/minchao/go-mitake v1.0.0 github.com/minchao/go-mitake v1.0.0
github.com/zeromicro/go-zero v1.7.0 github.com/zeromicro/go-zero v1.7.0
@ -48,14 +47,12 @@ require (
github.com/google/gofuzz v1.2.0 // indirect github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/css v1.0.0 // indirect github.com/gorilla/css v1.0.0 // indirect
github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/huandu/xstrings v1.2.0 // indirect github.com/huandu/xstrings v1.2.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect github.com/imdario/mergo v0.3.6 // indirect
github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0 // indirect github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0 // indirect
github.com/josharian/intern v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/mailru/easyjson v0.7.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-isatty v0.0.20 // indirect

View File

@ -36,11 +36,4 @@ type Config struct {
User string User string
Password string Password string
} }
// PyroScope 監控
PyroScope struct {
Enable bool
URL string
Token string
}
} }

View File

@ -1,46 +0,0 @@
package svc
import (
"code.30cm.net/digimon/app-cloudep-notification-service/internal/config"
"context"
"fmt"
"os"
"github.com/grafana/pyroscope-go"
"github.com/zeromicro/go-zero/core/logx"
)
func InitPyroScope(c config.Config) {
if c.PyroScope.Enable {
podName := os.Getenv("POD_NAME")
_, err := pyroscope.Start(pyroscope.Config{
ApplicationName: fmt.Sprintf("biz-%s-%s", c.Name, podName),
ServerAddress: c.PyroScope.URL,
Logger: logx.WithContext(context.Background()),
ProfileTypes: []pyroscope.ProfileType{
pyroscope.ProfileCPU,
pyroscope.ProfileInuseObjects,
pyroscope.ProfileAllocObjects,
pyroscope.ProfileInuseSpace,
pyroscope.ProfileAllocSpace,
pyroscope.ProfileGoroutines,
pyroscope.ProfileMutexCount,
pyroscope.ProfileMutexDuration,
pyroscope.ProfileBlockCount,
pyroscope.ProfileBlockDuration,
},
})
if err != nil {
logx.WithCallerSkip(1).WithFields(logx.LogField{
Key: "error", Value: err.Error(),
}).Error("failed to init pyroscope")
panic(fmt.Sprintf("Pyroscope start err: %s", err.Error()))
}
}
}

View File

@ -20,8 +20,6 @@ type ServiceContext struct {
func NewServiceContext(c config.Config) *ServiceContext { func NewServiceContext(c config.Config) *ServiceContext {
errs.Scope = code.CloudEPNotification errs.Scope = code.CloudEPNotification
InitPyroScope(c)
param := usecase.DeliveryUseCaseParam{} param := usecase.DeliveryUseCaseParam{}
if c.AmazonSesSettings.Enable { if c.AmazonSesSettings.Enable {
sesRepo := repository.MustAwsSesMailRepository(repository.AwsEmailDeliveryParam{ sesRepo := repository.MustAwsSesMailRepository(repository.AwsEmailDeliveryParam{