// Add a variable resolver.
18102
func (xpath *XPath) SetResolver(v VariableScope) {
	C.set_var_lookup(xpath.ContextPtr, unsafe.Pointer(&v))
	C.set_function_lookup(xpath.ContextPtr, unsafe.Pointer(&v))
}
768980
func (r *ProquintResolver) Resolve(ctx context.Context, name string, options ...opts.ResolveOpt) (path.Path, error) {
	return resolve(ctx, r, name, opts.ProcessOpts(options))
}
103777
func (c Configuration) Resolve() (string, error) {
	r, err := c.resolver()
	if err != nil {
		return "", err
	}
	return r.ID()
}
1071477
func OverrideResolve(resolveFN func(net string, addr string) (*net.TCPAddr, error)) {
	resolveTCPAddr.Store(resolveFN)
}
843666
func (sr *StaticResolver) Resolve(ctx context.Context) (string, connect.CertURI, error) {
	return sr.Addr, sr.CertURI, nil
}
438294
func (m *MultiResolver) Resolve(addr string) (h common.Hash, err error) {
	rs, err := m.getResolveValidator(addr)
	if err != nil {
		return h, err
	}
	for _, r := range rs {
		h, err = r.Resolve(addr)
		if err == nil {
			return
		}
	}
	return
}
399896
func (d DestinationAnyShard) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	if len(allShards) == 0 {
		return vterrors.Errorf(vtrpcpb.Code_UNAVAILABLE, "no shard in keyspace")
	}
	return addShard(allShards[AnyShardPicker.PickShard(len(allShards))].Name)
}
114760
func (r *Resolver) Resolve(t interface{}, id string) string {
	if r.cmd.Flags().Changed("no-resolve") {
		return id
	}
	if name, ok := r.cache[id]; ok {
		return name
	}
	name := r.get(t, id)
	r.cache[id] = name
	return name
}
1355005
func ValueToInterface(v Value, resolver Resolver) (interface{}, error) {
	switch v := v.(type) {
	case Null:
		return nil, nil
	case Boolean:
		return bool(v), nil
	case Number:
		return json.Number(v), nil
	case String:
		return string(v), nil
	case Array:
		buf := []interface{}{}
		for _, x := range v {
			x1, err := ValueToInterface(x.Value, resolver)
			if err != nil {
				return nil, err
			}
			buf = append(buf, x1)
		}
		return buf, nil
	case Object:
		buf := map[string]interface{}{}
		err := v.Iter(func(k, v *Term) error {
			ki, err := ValueToInterface(k.Value, resolver)
			if err != nil {
				return err
			}
			asStr, stringKey := ki.(string)
			if !stringKey {
				return fmt.Errorf("object value has non-string key (%T)", ki)
			}
			vi, err := ValueToInterface(v.Value, resolver)
			if err != nil {
				return err
			}
			buf[asStr] = vi
			return nil
		})
		if err != nil {
			return nil, err
		}
		return buf, nil
	case Set:
		buf := []interface{}{}
		err := v.Iter(func(x *Term) error {
			x1, err := ValueToInterface(x.Value, resolver)
			if err != nil {
				return err
			}
			buf = append(buf, x1)
			return nil
		})
		if err != nil {
			return nil, err
		}
		return buf, nil
	case Ref:
		return resolver.Resolve(v)
	default:
		return nil, fmt.Errorf("%v requires evaluation", TypeName(v))
	}
}
113732
func NewResolver(iface *net.Interface) (*Resolver, error) {
	c, err := newClient(iface)
	if err != nil {
		return nil, err
	}
	return &Resolver{c, c.closedCh}, nil
}
552614
func (r HighestScoreResolver) Resolve(value string) (*ComponentMatch, error) {
	matches, err := r.Searcher.Search(true, value)
	if len(matches) == 0 {
		return nil, ErrNoMatch{Value: value, Errs: err, Type: r.Searcher.Type()}
	}
	sort.Sort(ScoredComponentMatches(matches))
	return matches[0], errors.NewAggregate(err)
}
1315994
func (r *resolver) Resolve(it *config.Config) error {
	return r.resolveItem(r.single, it.Content, it.FormatSpec.Formatter)
}
109836
func (o *orphanBuildResolver) Resolve() ([]*buildv1.Build, error) {
	builds, err := o.dataSet.ListBuilds()
	if err != nil {
		return nil, err
	}

	results := []*buildv1.Build{}
	for _, build := range builds {
		if !o.BuildPhaseFilter.Has(string(build.Status.Phase)) {
			continue
		}
		isOrphan := false
		if build.Status.Config == nil {
			isOrphan = true
		} else {
			_, exists, _ := o.dataSet.GetBuildConfig(build)
			isOrphan = !exists
		}
		if isOrphan {
			results = append(results, build)
		}
	}
	return results, nil
}
382000
func (d DestinationKeyspaceIDs) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	for _, ksid := range d {
		shard, err := GetShardForKeyspaceID(allShards, ksid)
		if err != nil {
			return err
		}
		if err := addShard(shard); err != nil {
			return err
		}
	}
	return nil
}
1179397
func (it *Resolver) resolve(ctx context.Context) error {
	values, err := graph.RefsOf(ctx, it.qs, it.order)
	if err != nil {
		return err
	}
	for index, value := range values {
		node := it.order[index]
		it.values[node] = value
		it.nodes[value.Key()] = node
	}
	it.cached = true
	return nil
}
1089905
func (rule *Rule) AddVariable(variable *Variable) {
	for key, existingVariable := range rule.Variables {
		if existingVariable.Name == variable.Name {
			rule.Variables[key] = variable

			return
		}
	}

	rule.Variables = append(rule.Variables, variable)
}
620339
func resolveAllVariables(scope map[string]interface{}, tmplStr string) error {
	var unresolvedErr error
	_, allowAllItemRefs := scope[anyItemMagicValue] // 'item.*' is a magic placeholder value set by addItemsToScope
	fstTmpl := fasttemplate.New(tmplStr, "{{", "}}")

	fstTmpl.ExecuteFuncString(func(w io.Writer, tag string) (int, error) {

		// Skip the custom variable references
		if !checkValidWorkflowVariablePrefix(tag) {
			return 0, nil
		}
		_, ok := scope[tag]
		if !ok && unresolvedErr == nil {
			if (tag == "item" || strings.HasPrefix(tag, "item.")) && allowAllItemRefs {
				// we are *probably* referencing a undetermined item using withParam
				// NOTE: this is far from foolproof.
			} else if strings.HasPrefix(tag, common.GlobalVarWorkflowCreationTimestamp) {
			} else {
				unresolvedErr = fmt.Errorf("failed to resolve {{%s}}", tag)
			}
		}
		return 0, nil
	})
	return unresolvedErr
}