importcache

package
v0.277.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrAddFromCache

func GetOrAddFromCache(ctx context.Context, key string, add func() (rel.Expr, error)) (rel.Expr, error)

GetOrAddFromCache gets the cached expression based on the given filepath from the cache in context. If the file is not in the cache it will simply store the filepath and the expression in the cache. The function panics when cache is not in context.

func HasImportCacheFrom

func HasImportCacheFrom(ctx context.Context) bool

HasImportCacheFrom returns true if there is an import cache in the context.

func WithNewImportCache

func WithNewImportCache(ctx context.Context) context.Context

WithNewImportCache adds an empty cache to the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL