feat: rename SecurityService to Security (#2206)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2023-03-22 15:16:42 +08:00
parent 2cda1def7f
commit 6ac9f7f305
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
7 changed files with 18 additions and 18 deletions

2
go.mod
View File

@ -3,7 +3,7 @@ module d7y.io/dragonfly/v2
go 1.20 go 1.20
require ( require (
d7y.io/api v1.8.1 d7y.io/api v1.8.2
github.com/RichardKnop/machinery v1.10.6 github.com/RichardKnop/machinery v1.10.6
github.com/Showmax/go-fqdn v1.0.0 github.com/Showmax/go-fqdn v1.0.0
github.com/VividCortex/mysqlerr v1.0.0 github.com/VividCortex/mysqlerr v1.0.0

4
go.sum
View File

@ -51,8 +51,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
d7y.io/api v1.8.1 h1:eeKZZc5EEMdsk4SMNZ2wBy8tiGbXsNG9dmmMvejFOfE= d7y.io/api v1.8.2 h1:Sw+PhYMjq70t+wyG2AjhOnU/jJtctLzMs3xPySkAiPw=
d7y.io/api v1.8.1/go.mod h1:xMezpFrEljSfy/LINGkqg07BC2hzXqfTg7pzq5PIIZ8= d7y.io/api v1.8.2/go.mod h1:xMezpFrEljSfy/LINGkqg07BC2hzXqfTg7pzq5PIIZ8=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=

View File

@ -41,7 +41,7 @@ type securityServerV1 struct {
} }
// newSecurityServerV1 returns v1 version of the security server. // newSecurityServerV1 returns v1 version of the security server.
func newSecurityServerV1(selfSignedCert *SelfSignedCert) securityv1.CertificateServiceServer { func newSecurityServerV1(selfSignedCert *SelfSignedCert) securityv1.CertificateServer {
return &securityServerV1{ return &securityServerV1{
selfSignedCert: selfSignedCert, selfSignedCert: selfSignedCert,
} }

View File

@ -68,7 +68,7 @@ func GetV1ByAddr(ctx context.Context, target string, opts ...grpc.DialOption) (V
return &v1{ return &v1{
ManagerClient: managerv1.NewManagerClient(conn), ManagerClient: managerv1.NewManagerClient(conn),
CertificateServiceClient: securityv1.NewCertificateServiceClient(conn), CertificateClient: securityv1.NewCertificateClient(conn),
ClientConn: conn, ClientConn: conn,
}, nil }, nil
} }
@ -120,7 +120,7 @@ type V1 interface {
// v1 provides v1 version of the manager grpc function. // v1 provides v1 version of the manager grpc function.
type v1 struct { type v1 struct {
managerv1.ManagerClient managerv1.ManagerClient
securityv1.CertificateServiceClient securityv1.CertificateClient
*grpc.ClientConn *grpc.ClientConn
} }

View File

@ -68,7 +68,7 @@ func GetV2ByAddr(ctx context.Context, target string, opts ...grpc.DialOption) (V
return &v2{ return &v2{
ManagerClient: managerv2.NewManagerClient(conn), ManagerClient: managerv2.NewManagerClient(conn),
CertificateServiceClient: securityv1.NewCertificateServiceClient(conn), CertificateClient: securityv1.NewCertificateClient(conn),
ClientConn: conn, ClientConn: conn,
}, nil }, nil
} }
@ -120,7 +120,7 @@ type V2 interface {
// v2 provides v2 version of the manager grpc function. // v2 provides v2 version of the manager grpc function.
type v2 struct { type v2 struct {
managerv2.ManagerClient managerv2.ManagerClient
securityv1.CertificateServiceClient securityv1.CertificateClient
*grpc.ClientConn *grpc.ClientConn
} }

View File

@ -58,7 +58,7 @@ const (
) )
// New returns grpc server instance and register service on grpc server. // New returns grpc server instance and register service on grpc server.
func New(managerServerV1 managerv1.ManagerServer, managerServerV2 managerv2.ManagerServer, securityServer securityv1.CertificateServiceServer, opts ...grpc.ServerOption) *grpc.Server { func New(managerServerV1 managerv1.ManagerServer, managerServerV2 managerv2.ManagerServer, securityServer securityv1.CertificateServer, opts ...grpc.ServerOption) *grpc.Server {
limiter := rpc.NewRateLimiterInterceptor(DefaultQPS, DefaultBurst) limiter := rpc.NewRateLimiterInterceptor(DefaultQPS, DefaultBurst)
grpcServer := grpc.NewServer(append([]grpc.ServerOption{ grpcServer := grpc.NewServer(append([]grpc.ServerOption{
@ -92,7 +92,7 @@ func New(managerServerV1 managerv1.ManagerServer, managerServerV2 managerv2.Mana
managerv2.RegisterManagerServer(grpcServer, managerServerV2) managerv2.RegisterManagerServer(grpcServer, managerServerV2)
// Register security on grpc server. // Register security on grpc server.
securityv1.RegisterCertificateServiceServer(grpcServer, securityServer) securityv1.RegisterCertificateServer(grpcServer, securityServer)
// Register health on grpc server. // Register health on grpc server.
healthpb.RegisterHealthServer(grpcServer, health.NewServer()) healthpb.RegisterHealthServer(grpcServer, health.NewServer())

View File

@ -76,7 +76,7 @@ func GetV1(ctx context.Context, target string, opts ...grpc.DialOption) (V1, err
} }
return &v1{ return &v1{
CertificateServiceClient: securityv1.NewCertificateServiceClient(conn), CertificateClient: securityv1.NewCertificateClient(conn),
ClientConn: conn, ClientConn: conn,
}, nil }, nil
} }
@ -106,7 +106,7 @@ type V1 interface {
// clientV1 provides v1 version of the manager grpc function. // clientV1 provides v1 version of the manager grpc function.
type v1 struct { type v1 struct {
securityv1.CertificateServiceClient securityv1.CertificateClient
*grpc.ClientConn *grpc.ClientConn
} }
@ -115,5 +115,5 @@ func (v *v1) IssueCertificate(ctx context.Context, req *securityv1.CertificateRe
ctx, cancel := context.WithTimeout(ctx, contextTimeout) ctx, cancel := context.WithTimeout(ctx, contextTimeout)
defer cancel() defer cancel()
return v.CertificateServiceClient.IssueCertificate(ctx, req, opts...) return v.CertificateClient.IssueCertificate(ctx, req, opts...)
} }