micro/service/grpc/options.go

22 lines
364 B
Go
Raw Normal View History

2019-06-03 18:44:43 +01:00
package grpc
import (
"crypto/tls"
"github.com/micro/go-micro"
2019-06-05 10:22:28 +01:00
gc "github.com/micro/go-micro/client/grpc"
gs "github.com/micro/go-micro/server/grpc"
2019-06-03 18:44:43 +01:00
)
// WithTLS sets the TLS config for the service
func WithTLS(t *tls.Config) micro.Option {
return func(o *micro.Options) {
o.Client.Init(
gc.AuthTLS(t),
)
o.Server.Init(
gs.AuthTLS(t),
)
}
}