Lines Matching refs:provider
45 type provider struct { struct
52 type ProviderKey *provider
85 provider := &provider{
92 providerRegistry = append(providerRegistry, provider)
94 return provider
101 for _, provider := range providerRegistry {
103 if mutator.name == provider.mutator {
104 c.providerMutators[provider.id] = mutator
116 func (c *Context) setProvider(m *moduleInfo, provider ProviderKey, value interface{}) {
117 if provider.mutator == "" {
120 provider.typ))
123 provider.typ))
126 expectedMutator := c.providerMutators[provider.id]
129 provider.typ, provider.mutator))
132 provider.typ, provider.mutator))
135 provider.typ, provider.mutator))
139 if typ := reflect.TypeOf(value); typ != provider.typ {
141 provider.typ, typ))
148 if m.providers[provider.id] != nil {
149 panic(fmt.Sprintf("Value of provider %s is already set", provider.typ))
152 m.providers[provider.id] = value
163 func (c *Context) provider(m *moduleInfo, provider ProviderKey) (interface{}, bool) { func
164 if provider.mutator == "" {
167 provider.typ))
170 expectedMutator := c.providerMutators[provider.id]
173 provider.typ, provider.mutator))
177 if len(m.providers) > provider.id {
178 if p := m.providers[provider.id]; p != nil {
183 return provider.zero, false