Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RPCDeadline is the deadline applied to config service RPCs. RPCDeadline = 10 * time.Minute )
Variables ¶
View Source
var Cache = datastorecache.Cache{ Name: "go.chromium.org/luci/appengine/gaeconfig", AccessUpdateInterval: 24 * time.Hour, PruneFactor: 4, Parallel: 16, HandlerFunc: getCacheHandler, }
Cache is our registered datastore cache, bound to our Config Handler. The generator function is used by the cache manager task to get a Handler instance during refresh.
Functions ¶
Types ¶
type Config ¶
type Config struct { // RefreshInterval is the cache entry refresh interval. RefreshInterval time.Duration // FailOpen, if true, means that a cache miss or failure should be passed // through to the underlying cache. FailOpen bool // LockerFunc returns the Locker instance to use. LockerFunc func(context.Context) datastorecache.Locker // contains filtered or unexported fields }
Config is a datastore cache configuration.
Cache parameters can be extracted from a config instance.
func (*Config) WithHandler ¶
func (dc *Config) WithHandler(c context.Context, l caching.Loader, timeout time.Duration) context.Context
WithHandler installs a datastorecache.Handler into our Context. This is used during datastore cache's Refresh calls.
The Handler binds the parameters and Loader to the resolution call. For service resolution, this will be the Loader that is provided by the caching layer. For cron refresh, this will be the generic Loader provided by CronLoader.
Click to show internal directories.
Click to hide internal directories.