readd service package (#2026)

This commit is contained in:
Asim Aslam
2020-09-26 13:15:05 +01:00
committed by GitHub
parent 6e2c9e7cd4
commit d8f17ac827
9 changed files with 1000 additions and 0 deletions

21
service/grpc/options.go Normal file
View File

@@ -0,0 +1,21 @@
package grpc
import (
"crypto/tls"
gc "github.com/micro/go-micro/v3/client/grpc"
gs "github.com/micro/go-micro/v3/server/grpc"
"github.com/micro/go-micro/v3/service"
)
// WithTLS sets the TLS config for the service
func WithTLS(t *tls.Config) service.Option {
return func(o *service.Options) {
o.Client.Init(
gc.AuthTLS(t),
)
o.Server.Init(
gs.AuthTLS(t),
)
}
}