@@ -59,7 +59,7 @@ type ServeOpts struct {
59
59
GRPCSettings GRPCSettings
60
60
}
61
61
62
- func asGRPCServeOpts (opts ServeOpts ) grpcplugin.ServeOpts {
62
+ func GRPCServeOpts (opts ServeOpts ) grpcplugin.ServeOpts {
63
63
pluginOpts := grpcplugin.ServeOpts {
64
64
DiagnosticsServer : newDiagnosticsSDKAdapter (prometheus .DefaultGatherer , opts .CheckHealthHandler ),
65
65
}
@@ -112,7 +112,7 @@ func defaultGRPCMiddlewares(opts ServeOpts) []grpc.ServerOption {
112
112
// Serve starts serving the plugin over gRPC.
113
113
func Serve (opts ServeOpts ) error {
114
114
grpc_prometheus .EnableHandlingTimeHistogram ()
115
- pluginOpts := asGRPCServeOpts (opts )
115
+ pluginOpts := GRPCServeOpts (opts )
116
116
pluginOpts .GRPCServer = func (customOptions []grpc.ServerOption ) * grpc.Server {
117
117
return grpc .NewServer (grpcServerOptions (opts , customOptions ... )... )
118
118
}
@@ -163,7 +163,7 @@ func GracefulStandaloneServe(dsopts ServeOpts, info standalone.ServerSettings) e
163
163
standalone .FindAndKillCurrentPlugin (info .Dir )
164
164
165
165
// Start GRPC server
166
- pluginOpts := asGRPCServeOpts (dsopts )
166
+ pluginOpts := GRPCServeOpts (dsopts )
167
167
if pluginOpts .GRPCServer == nil {
168
168
pluginOpts .GRPCServer = func (customOptions []grpc.ServerOption ) * grpc.Server {
169
169
return grpc .NewServer (grpcServerOptions (dsopts , customOptions ... )... )
@@ -265,7 +265,7 @@ func Manage(pluginID string, serveOpts ServeOpts) error {
265
265
// TestStandaloneServe starts a gRPC server that is not managed by hashicorp.
266
266
// The function returns the gRPC server which should be closed by the consumer.
267
267
func TestStandaloneServe (opts ServeOpts , address string ) (* grpc.Server , error ) {
268
- pluginOpts := asGRPCServeOpts (opts )
268
+ pluginOpts := GRPCServeOpts (opts )
269
269
if pluginOpts .GRPCServer == nil {
270
270
pluginOpts .GRPCServer = func (customOptions []grpc.ServerOption ) * grpc.Server {
271
271
return grpc .NewServer (grpcServerOptions (opts , customOptions ... )... )
0 commit comments