Documentation ¶
Overview ¶
Package service contains logics around working with service config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
Finder provides fast look up for services interested in the provided config.
It loads `Service` entity for all registered services and pre-compute the ConfigPattern to in-memory data structures that promotes faster matching performance.
See ConfigPattern syntax at https://pkg.go.dev/go.chromium.org/luci/common/proto/config#ConfigPattern
It can be used as an one-off look up. However, to unlock its full ability, the caller should use a singleton and call `RefreshPeriodically` in the background to keep the singleton's pre-computed patterns up-to-date with.
func (*Finder) FindInterestedServices ¶
func (m *Finder) FindInterestedServices(ctx context.Context, cs config.Set, filePath string) []*model.Service
FindInterestedServices look up for services interested in the given config.
Look-up is performed in memory.
func (*Finder) RefreshPeriodically ¶
RefreshPeriodically refreshes the finder with the latest registered services information every 1 minute until context is cancelled.
Log the error if refresh has failed.