(base ServiceConstructor, kind reflect.Type)
| 74 | type InstrumentingWrapper func(base ServiceConstructor) ServiceConstructor |
| 75 | |
| 76 | func InstrumentingWrapperMaker(base ServiceConstructor, kind reflect.Type) ServiceConstructor { |
| 77 | return func(ctx *ServiceContext) (Service, error) { |
| 78 | obj, err := base(ctx) |
| 79 | if err != nil { |
| 80 | return nil, err |
| 81 | } |
| 82 | wrapper := reflect.New(kind) |
| 83 | wrapper.Elem().Field(0).Set(reflect.ValueOf(obj).Elem()) |
| 84 | |
| 85 | return wrapper.Interface().(Service), nil |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | // Set of services all wrapping the base InstrumentedService resulting in the |
| 90 | // same method signatures but different outer types. |
no test coverage detected