MCPcopy Index your code
hub / github.com/FunctionStream/function-stream / setupFactories

Function setupFactories

server/server.go:189–201  ·  view source on GitHub ↗
(factoryBuilder map[string]func(configMap common.ConfigMap) (T, error),
	config map[string]common.ConfigMap,
)

Source from the content-addressed store, hash-verified

187}
188
189func setupFactories[T any](factoryBuilder map[string]func(configMap common.ConfigMap) (T, error),
190 config map[string]common.ConfigMap,
191) (map[string]T, error) {
192 factories := make(map[string]T)
193 for name, builder := range factoryBuilder {
194 f, err := builder(config[name])
195 if err != nil {
196 return nil, fmt.Errorf("error creating factory [%s] %w", name, err)
197 }
198 factories[name] = f
199 }
200 return factories, nil
201}
202
203func DefaultStateStoreLoader(c *StateStoreConfig) (api.StateStore, error) {
204 switch strings.ToLower(*c.Type) {

Callers 1

NewServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected