Compare commits
No commits in common. "main" and "v0.0.1" have entirely different histories.
|
@ -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
3
go.mod
|
@ -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
|
||||||
|
|
|
@ -36,11 +36,4 @@ type Config struct {
|
||||||
User string
|
User string
|
||||||
Password string
|
Password string
|
||||||
}
|
}
|
||||||
|
|
||||||
// PyroScope 監控
|
|
||||||
PyroScope struct {
|
|
||||||
Enable bool
|
|
||||||
URL string
|
|
||||||
Token string
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package senderservicelogic
|
package senderservicelogic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/template"
|
"app-cloudep-notification-service/pkg/domain/template"
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/gen_result/pb/notification"
|
"app-cloudep-notification-service/gen_result/pb/notification"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/internal/svc"
|
"app-cloudep-notification-service/internal/svc"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package senderservicelogic
|
package senderservicelogic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/usecase"
|
"app-cloudep-notification-service/pkg/domain/usecase"
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/gen_result/pb/notification"
|
"app-cloudep-notification-service/gen_result/pb/notification"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/internal/svc"
|
"app-cloudep-notification-service/internal/svc"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package senderservicelogic
|
package senderservicelogic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/usecase"
|
"app-cloudep-notification-service/pkg/domain/usecase"
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/gen_result/pb/notification"
|
"app-cloudep-notification-service/gen_result/pb/notification"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/internal/svc"
|
"app-cloudep-notification-service/internal/svc"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,9 +7,9 @@ package server
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/gen_result/pb/notification"
|
"app-cloudep-notification-service/gen_result/pb/notification"
|
||||||
senderservicelogic "code.30cm.net/digimon/app-cloudep-notification-service/internal/logic/senderservice"
|
senderservicelogic "app-cloudep-notification-service/internal/logic/senderservice"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/internal/svc"
|
"app-cloudep-notification-service/internal/svc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SenderServiceServer struct {
|
type SenderServiceServer struct {
|
||||||
|
|
|
@ -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()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +1,11 @@
|
||||||
package svc
|
package svc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/internal/config"
|
"app-cloudep-notification-service/internal/config"
|
||||||
cfg "code.30cm.net/digimon/app-cloudep-notification-service/pkg/config"
|
cfg "app-cloudep-notification-service/pkg/config"
|
||||||
useD "code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/usecase"
|
useD "app-cloudep-notification-service/pkg/domain/usecase"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/repository"
|
"app-cloudep-notification-service/pkg/repository"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/usecase"
|
"app-cloudep-notification-service/pkg/usecase"
|
||||||
|
|
||||||
"code.30cm.net/digimon/library-go/errs"
|
"code.30cm.net/digimon/library-go/errs"
|
||||||
"code.30cm.net/digimon/library-go/errs/code"
|
"code.30cm.net/digimon/library-go/errs/code"
|
||||||
|
@ -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{
|
||||||
|
|
|
@ -5,10 +5,10 @@ import (
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/gen_result/pb/notification"
|
"app-cloudep-notification-service/gen_result/pb/notification"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/internal/config"
|
"app-cloudep-notification-service/internal/config"
|
||||||
senderserviceServer "code.30cm.net/digimon/app-cloudep-notification-service/internal/server/senderservice"
|
senderserviceServer "app-cloudep-notification-service/internal/server/senderservice"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/internal/svc"
|
"app-cloudep-notification-service/internal/svc"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/conf"
|
"github.com/zeromicro/go-zero/core/conf"
|
||||||
"github.com/zeromicro/go-zero/core/service"
|
"github.com/zeromicro/go-zero/core/service"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package usecase
|
package usecase
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/repository"
|
"app-cloudep-notification-service/pkg/domain/repository"
|
||||||
"context"
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package usecase
|
package usecase
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/template"
|
"app-cloudep-notification-service/pkg/domain/template"
|
||||||
"context"
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package repository
|
package repository
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/config"
|
"app-cloudep-notification-service/pkg/config"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain"
|
"app-cloudep-notification-service/pkg/domain"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/repository"
|
"app-cloudep-notification-service/pkg/domain/repository"
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package repository
|
package repository
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/config"
|
"app-cloudep-notification-service/pkg/config"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain"
|
"app-cloudep-notification-service/pkg/domain"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/repository"
|
"app-cloudep-notification-service/pkg/domain/repository"
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"code.30cm.net/digimon/library-go/errs/code"
|
"code.30cm.net/digimon/library-go/errs/code"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package repository
|
package repository
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/config"
|
"app-cloudep-notification-service/pkg/config"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/repository"
|
"app-cloudep-notification-service/pkg/domain/repository"
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
pool "code.30cm.net/digimon/library-go/worker_pool"
|
pool "code.30cm.net/digimon/library-go/worker_pool"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package usecase
|
package usecase
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/repository"
|
"app-cloudep-notification-service/pkg/domain/repository"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/usecase"
|
"app-cloudep-notification-service/pkg/domain/usecase"
|
||||||
"context"
|
"context"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package usecase
|
package usecase
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/template"
|
"app-cloudep-notification-service/pkg/domain/template"
|
||||||
"code.30cm.net/digimon/app-cloudep-notification-service/pkg/domain/usecase"
|
"app-cloudep-notification-service/pkg/domain/usecase"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue