micro/service/grpc/options.go
Asim Aslam 563768b58a
v3 refactor (#1868)
* Move to v3

Co-authored-by: Ben Toogood <bentoogood@gmail.com>
2020-07-27 13:22:00 +01:00

22 lines
385 B
Go

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),
)
}
}