// UseLocalCache causes Codec to cache items in local LRU cache.
500331
func (cd *Codec) UseLocalCache(maxLen int, expiration time.Duration) {
	cd.localCache = lrucache.New(maxLen, expiration)
}
995936
func NewLocalProvider(config fab.EndpointConfig, opts ...coptions.Opt) *LocalProvider {
	return &LocalProvider{
		cache: lazycache.New("Local_Discovery_Service_Cache", func(key lazycache.Key) (interface{}, error) {
			return newLocalService(config, key.String(), opts...), nil
		}),
	}
}
447355
func lookupLocal(use use) binding {
	for env := use.env; env != nil; env = env.parent {
		if bind, ok := env.bindings[use.id.Name]; ok {
			if bind.scope == Free {
				// shouldn't exist till later
				log.Fatalf("%s: internal error: %s, %d", use.id.NamePos, use.id.Name, bind)
			}
			return bind // found
		}
		if env.function != nil {
			break
		}
	}
	return binding{} // not found in this function
}
87534
func NewCache() *Cache {
	return &Cache{
		BaseObservableResourceSource: NewBaseObservableResourceSource(),
		resources:                    make(map[cacheKey]cacheValue),
		version:                      1,
	}
}
1067506
func (s *DeploymentCanarySettings) SetUseStageCache(v bool) *DeploymentCanarySettings {
	s.UseStageCache = &v
	return s
}
86062
func (c *UsersListCall) IncludeLocale(includeLocale bool) *UsersListCall {
	c.includeLocale = includeLocale
	return c
}
1231243
func (s *UpdateByQueryService) RequestCache(requestCache bool) *UpdateByQueryService {
	s.requestCache = &requestCache
	return s
}
406999
func (l *Language) GetLocal(key string) interface{} {
	if l == nil {
		panic("language not set")
	}
	key = strings.ToLower(key)
	if !globalOnlySettings[key] {
		if v, ok := l.settings[key]; ok {
			return v
		}
	}
	return nil
}
1057452
func (e *edge) loadCache(ctx context.Context) (interface{}, error) {
	recs := make([]*CacheRecord, 0, len(e.cacheRecords))
	for _, r := range e.cacheRecords {
		recs = append(recs, r)
	}

	rec := getBestResult(recs)

	logrus.Debugf("load cache for %s with %s", e.edge.Vertex.Name(), rec.ID)
	res, err := e.op.LoadCache(ctx, rec)
	if err != nil {
		return nil, err
	}

	return NewCachedResult(res, []ExportableCacheKey{{CacheKey: rec.key, Exporter: &exporter{k: rec.key, record: rec, edge: e}}}), nil
}
1179338
func (obj *Doc) GetLocaleInfo(ctx context.Context) (*LocaleInfo, error) {
	result := &struct {
		Return *LocaleInfo	`json:"qReturn"`
	} {}
	err := obj.rpc(ctx, "GetLocaleInfo", result)
	return result.Return, err 
}
1271843
func (i *ImageService) MakeImageCache(sourceRefs []string) builder.ImageCache {
	if len(sourceRefs) == 0 {
		return cache.NewLocal(i.imageStore)
	}

	cache := cache.New(i.imageStore)

	for _, ref := range sourceRefs {
		img, err := i.GetImage(ref)
		if err != nil {
			logrus.Warnf("Could not look up %s for cache resolution, skipping: %+v", ref, err)
			continue
		}
		cache.Populate(img)
	}

	return cache
}
1110252
func WithLocalDiscoveryProvider(discoveryProvider fab.LocalDiscoveryProvider) SDKContextParams {
	return func(ctx *Provider) {
		ctx.localDiscoveryProvider = discoveryProvider
	}
}
371499
func getLocal(url string, fs afero.Fs, cfg config.Provider) ([]byte, error) {
	filename := filepath.Join(cfg.GetString("workingDir"), url)
	if e, err := helpers.Exists(filename, fs); !e {
		return nil, err
	}

	return afero.ReadFile(fs, filename)

}
31134
func (s *SharedStore) UpdateLocalKey(key LocalKey) {
	s.mutex.Lock()
	s.localKeys[key.GetKeyName()] = key.DeepKeyCopy()
	s.mutex.Unlock()
}
612389
func (e *Encoder) UseCompactEncoding(flag bool) *Encoder {
	e.useCompact = flag
	return e
}
403132
func (apic *APICache) Utilization() float64 {
	apic.mtx.RLock()
	defer apic.mtx.RUnlock()
	return 100.0 * float64(len(apic.blockCache)) / float64(apic.capacity)
}
759408
func newCache() *cache {
	c := cache{
		m:       make(map[reflect.Type]*structInfo),
		regconv: make(map[reflect.Type]Converter),
		tag:     "schema",
	}
	return &c
}