Files
go-libs/pkg/testing/testservice/instrumentation_grpcserver.go

21 lines
473 B
Go

package testservice
import (
"context"
"github.com/hanzo-fi/go-libs/v5/pkg/transport/grpcserver"
)
func GRPCServerInstrumentation() Instrumentation {
return InstrumentationFunc(func(ctx context.Context, cfg *RunConfiguration) error {
cfg.WrapContext(func(ctx context.Context) context.Context {
return grpcserver.ContextWithServerInfo(ctx)
})
return nil
})
}
func GetGRPCAddress(service *Service) string {
return grpcserver.Address(service.GetContext())
}