MCPcopy Create free account
hub / github.com/cloudbase/garm / composeControllerWatcherFilters

Function composeControllerWatcherFilters

workers/entity/util.go:30–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28)
29
30func composeControllerWatcherFilters() dbCommon.PayloadFilterFunc {
31 return watcher.WithAny(
32 watcher.WithAll(
33 watcher.WithAny(
34 watcher.WithEntityTypeFilter(dbCommon.RepositoryEntityType),
35 watcher.WithEntityTypeFilter(dbCommon.OrganizationEntityType),
36 watcher.WithEntityTypeFilter(dbCommon.EnterpriseEntityType),
37 ),
38 watcher.WithAny(
39 watcher.WithOperationTypeFilter(dbCommon.CreateOperation),
40 watcher.WithOperationTypeFilter(dbCommon.DeleteOperation),
41 watcher.WithOperationTypeFilter(dbCommon.UpdateOperation),
42 ),
43 ),
44 // Watch for credential updates so we can propagate them to non-running workers.
45 watcher.WithAll(
46 watcher.WithAny(
47 watcher.WithEntityTypeFilter(dbCommon.GithubCredentialsEntityType),
48 watcher.WithEntityTypeFilter(dbCommon.GiteaCredentialsEntityType),
49 ),
50 watcher.WithOperationTypeFilter(dbCommon.UpdateOperation),
51 ),
52 )
53}
54
55func composeWorkerWatcherFilters(entity params.ForgeEntity) dbCommon.PayloadFilterFunc {
56 return watcher.WithAny(

Callers 1

StartMethod · 0.70

Calls 4

WithAnyFunction · 0.92
WithAllFunction · 0.92
WithEntityTypeFilterFunction · 0.92
WithOperationTypeFilterFunction · 0.92

Tested by

no test coverage detected