// Lookup a client
180892
func (cs *clientStore) lookup(ID string) *client {
	cs.RLock()
	c := cs.clients[ID]
	cs.RUnlock()
	return c
}
5428
func (cf *Filter) Lookup(data []byte) bool {
	i1, i2, fp := getIndicesAndFingerprint(data, uint(len(cf.buckets)))
	b1, b2 := cf.buckets[i1], cf.buckets[i2]
	return b1.getFingerprintIndex(fp) > -1 || b2.getFingerprintIndex(fp) > -1
}
864391
func (r *router) GetClient(key string) (client interface{}, isRemote bool, err error) {
	dest, err := r.ringpop.Lookup(key)
	if err != nil {
		return nil, false, err
	}

	return r.getClientByHost(dest)
}
29995
func (s *CombinedMapSlice) lookup(v MergeKeyValue) *ListItem {
	for _, i := range s.Items {
		if i.KeyValue.Equal(v) {
			return i
		}
	}
	return nil
}
568802
func Lookup(providerType string) ProviderCreator {
	providersMu.Lock()
	defer providersMu.Unlock()
	return providers[providerType]
}
742399
func (cs *clientStore) lookupByConnIDOrID(ID string, connID []byte) *client {
	var c *client
	if len(connID) > 0 {
		c = cs.connIDs[string(connID)]
	} else {
		c = cs.clients[ID]
	}
	return c
}
700780
func GetClient(URL string, bc *BasicClient) Client {
	clients := []struct {
		URL  string
		Func clientCreationFunc
	}{
		{"https://ofx.discovercard.com", NewDiscoverCardClient},
		{"https://vesnc.vanguard.com/us/OfxDirectConnectServlet", NewVanguardClient},
	}
	for _, client := range clients {
		if client.URL == strings.Trim(URL, "/") {
			return client.Func(bc)
		}
	}
	return bc
}
1010081
func (o *OrganizationLookup) Lookup(ctx context.Context, name string) (platform.ID, bool) {
	org, err := o.OrganizationService.FindOrganization(
		ctx,
		platform.OrganizationFilter{Name: &name},
	)

	if err != nil {
		return platform.InvalidID(), false
	}
	return org.ID, true
}
733101
func (h *Hosts) Lookup(host string) (ip net.IP) {
	if h == nil || host == "" {
		return
	}

	h.mux.RLock()
	defer h.mux.RUnlock()

	for _, h := range h.hosts {
		if h.Hostname == host {
			ip = h.IP
			break
		}
		for _, alias := range h.Aliases {
			if alias == host {
				ip = h.IP
				break
			}
		}
	}
	if ip != nil && Debug {
		log.Logf("[hosts] hit: %s %s", host, ip.String())
	}
	return
}
708248
func (tlf *TLF) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (fs.Node, error) {
	if tlfLoadAvoidingLookupNames[req.Name] {
		dir := tlf.getStoredDir()
		if dir == nil {
			tlf.vlog().CLogf(
				ctx, libkb.VLog1, "Avoiding TLF loading for name %s", req.Name)
			return nil, fuse.ENOENT
		}
		return dir.Lookup(ctx, req, resp)
	}

	dir, exitEarly, err := tlf.loadDirAllowNonexistent(ctx)
	if err != nil {
		return nil, err
	}
	if exitEarly {
		if node := handleTLFSpecialFile(
			req.Name, tlf.folder, &resp.EntryValid); node != nil {
			return node, nil
		}
		return nil, fuse.ENOENT
	}

	branch, isArchivedBranch := libfs.BranchNameFromArchiveRefDir(req.Name)
	if isArchivedBranch {
		archivedTLF := newTLF(ctx,
			tlf.folder.list, tlf.folder.h, tlf.folder.hPreferredName)
		_, _, err := archivedTLF.loadArchivedDir(ctx, branch)
		if err != nil {
			return nil, err
		}
		return archivedTLF, nil
	}

	linkTarget, isArchivedTimeLink, err := libfs.LinkTargetFromTimeString(
		ctx, tlf.folder.fs.config, tlf.folder.h, req.Name)
	if err != nil {
		return nil, err
	}
	if isArchivedTimeLink {
		return &Alias{
			realPath: linkTarget,
			inode:    0,
		}, nil
	}

	_, isRelTimeLink, err := libfs.FileDataFromRelativeTimeString(
		ctx, tlf.folder.fs.config, tlf.folder.h, req.Name)
	if err != nil {
		return nil, err
	}
	if isRelTimeLink {
		return NewArchiveRelTimeFile(
			tlf.folder.fs, tlf.folder.h, req.Name, &resp.EntryValid), nil
	}

	return dir.Lookup(ctx, req, resp)
}
767347
func LookupInstance(ctx context.Context, instance string) (Service, error) {
	var srv Service

	conn, err := NewMDNSConn()
	if err != nil {
		return srv, err
	}

	return lookupInstance(ctx, instance, conn)
}
522255
func (e *Etcd) Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error) {
	return e.Upstream.Lookup(ctx, state, name, typ)
}
111268
func (dk *BasicDockerKeyring) Lookup(image string) ([]docker.AuthConfiguration, bool) {
	// range over the index as iterating over a map does not provide a predictable ordering
	ret := []docker.AuthConfiguration{}
	for _, k := range dk.index {
		// both k and image are schemeless URLs because even though schemes are allowed
		// in the credential configurations, we remove them in Add.
		if matched, _ := urlsMatchStr(k, image); !matched {
			continue
		}

		ret = append(ret, dk.creds[k]...)
	}

	if len(ret) > 0 {
		return ret, true
	}

	// Use credentials for the default registry if provided, and appropriate
	if isDefaultRegistryMatch(image) {
		if auth, ok := dk.creds[defaultRegistryHost]; ok {
			return auth, true
		}
	}

	return []docker.AuthConfiguration{}, false
}
399691
func (c *defConfigBackend) Lookup(key string) (interface{}, bool) {
	value := c.configViper.Get(key)
	if value == nil {
		return nil, false
	}
	return value, true
}
214065
func (h *Handler) Lookup(ctx context.Context, query *Query) (*cacheEntry, error) {

	timeLimit := query.TimeLimit
	if timeLimit == 0 { // if time limit is set to zero, the user wants to get the latest update
		timeLimit = TimestampProvider.Now().Time
	}

	if query.Hint == lookup.NoClue { // try to use our cache
		entry := h.get(&query.Feed)
		if entry != nil && entry.Epoch.Time <= timeLimit { // avoid bad hints
			query.Hint = entry.Epoch
		}
	}

	// we can't look for anything without a store
	if h.chunkStore == nil {
		return nil, NewError(ErrInit, "Call Handler.SetStore() before performing lookups")
	}

	var readCount int

	// Invoke the lookup engine.
	// The callback will be called every time the lookup algorithm needs to guess
	requestPtr, err := lookup.Lookup(ctx, timeLimit, query.Hint, func(ctx context.Context, epoch lookup.Epoch, now uint64) (interface{}, error) {
		readCount++
		id := ID{
			Feed:  query.Feed,
			Epoch: epoch,
		}
		ctx, cancel := context.WithTimeout(ctx, defaultRetrieveTimeout)
		defer cancel()

		chunk, err := h.chunkStore.Get(ctx, id.Addr())
		if err != nil {
			if err == context.DeadlineExceeded { // chunk not found
				return nil, nil
			}
			return nil, err //something else happened or context was cancelled.
		}

		var request Request
		if err := request.fromChunk(chunk); err != nil {
			return nil, nil
		}
		if request.Time <= timeLimit {
			return &request, nil
		}
		return nil, nil
	})
	if err != nil {
		return nil, err
	}

	log.Info(fmt.Sprintf("Feed lookup finished in %d lookups", readCount))

	request, _ := requestPtr.(*Request)
	if request == nil {
		return nil, NewError(ErrNotFound, "no feed updates found")
	}
	return h.updateCache(request)

}
807521
func (s *StructStruct) Lookup(path ...string) *StructField {
	name := path[0]
	if len(path) == 1 {
		for _, item := range s.data {
			if item.Name() == name {
				return item
			}
		}
		return nil
	}
	for _, item := range s.data {
		if item.embedded != nil && item.Name() == name {
			return item.embedded.Lookup(path[1:]...)
		}
	}
	return nil
}
1361788
func (s *Sensu) GetClient(client string) (map[string]interface{}, error) {
	return s.get(fmt.Sprintf("clients/%s", client))
}