mirror of
https://github.com/hanzo-fi/go-libs.git
synced 2026-10-30 20:53:44 +00:00
21 lines
473 B
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())
|
|
}
|