Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cacher ¶
func NewCacher ¶
func NewCacher(repo repo, logger logrus.FieldLogger) *Cacher
func NewCacherWithGroup ¶ added in v1.19.0
func NewCacherWithGroup(repo repo, logger logrus.FieldLogger) *Cacher
func (*Cacher) Build ¶
func (c *Cacher) Build(ctx context.Context, objects []search.Result, properties search.SelectProperties, additional additional.Properties, ) error
Build builds the lookup cache recursively and tries to be smart about it. This means that it aims to use only a single (multiget) transaction per layer. The recursion exit condition is jobs marked as done. At some point the cacher will realise that for every nested prop there is already a complete job, so it it stop the recursion.
build is called on a "level" i.e. the search result. After working on the job list for the first time if the resolved items still contain references and the user set the SelectProperty to indicate they want to resolve them, build is called again on all the results (plural!) from the previous run. We thus end up with one request to the backend per level regardless of the amount of lookups per level.
This keeps request times to a minimum even on deeply nested requests.
func (*Cacher) ReplaceInitialPropertiesWithSpecific ¶
func (c *Cacher) ReplaceInitialPropertiesWithSpecific(obj search.Result, properties search.SelectProperties, ) (search.SelectProperties, error)
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver(cacher cacher) *Resolver
func NewResolverWithGroup ¶ added in v1.19.0
func NewResolverWithGroup(cacher cacher) *Resolver
func (*Resolver) Do ¶
func (r *Resolver) Do(ctx context.Context, objects []search.Result, properties search.SelectProperties, additional additional.Properties, ) ([]search.Result, error)