MCPcopy
hub / github.com/openziti/ziti / GetTypedProvider

Function GetTypedProvider

controller/ioc/typed_registry.go:80–86  ·  view source on GitHub ↗
(r *TypedRegistry)

Source from the content-addressed store, hash-verified

78}
79
80func GetTypedProvider[T any](r *TypedRegistry) TypedProvider[T] {
81 p := r.m.Get(reflect.TypeFor[T]())
82 if tp, ok := p.(TypedProvider[T]); ok {
83 return tp
84 }
85 return nil
86}
87
88func RegisterTyped[T any](r *TypedRegistry, provider TypedProvider[T]) {
89 r.m.Put(reflect.TypeFor[T](), provider)

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected