MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / newParamsRegistry

Function newParamsRegistry

scope.go:508–526  ·  view source on GitHub ↗
(params []config.Param)

Source from the content-addressed store, hash-verified

506}
507
508func newParamsRegistry(params []config.Param) (*paramsRegistry, error) {
509 if len(params) == 0 {
510 return nil, fmt.Errorf("params can't be empty")
511 }
512
513 paramsMap := make(map[string]string, len(params))
514 for _, k := range params {
515 paramsMap[k.Key] = k.Value
516 }
517 key, err := calcMapHash(paramsMap)
518 if err != nil {
519 return nil, err
520 }
521
522 return &paramsRegistry{
523 key: key,
524 params: params,
525 }, nil
526}
527
528type user struct {
529 name string

Callers 1

paramsFromConfigFunction · 0.85

Calls 1

calcMapHashFunction · 0.85

Tested by

no test coverage detected