Commit graph

12 commits

Author SHA1 Message Date
Eric Lippmann
f3eeb61b54 Introduce contracts#SafeInit() 2024-05-22 11:51:22 +02:00
Eric Lippmann
aa3c00893f Move contracts#Waiter{,Func} to com#Waiter{,Func} 2024-05-22 11:51:21 +02:00
Eric Lippmann
1e32978651 Use google/go-cmp to determine equality of checksums
Otherwise we would have to move the `Equaler` interface to the
`types` package, which is pretty useless for a single use case.
2024-05-22 11:51:21 +02:00
Eric Lippmann
75501e11f8 Move database related contracts to database/contracts 2024-05-22 11:51:21 +02:00
Eric Lippmann
a081927672 Only sync entities that belong to the current environment
Previously, we selected each entity from the database.
Now we only select entities that belong to the current environment.
2021-11-03 15:47:38 +01:00
Eric Lippmann
4d65c62f77 Handle contracts.Initer in common.NewSyncSubject()
contracts.EntitiyFactoryFunc.WithInit() checked for
contracts.Initer every time.
Now it is only done once in common.NewSyncSubject().
2021-10-26 09:31:36 +02:00
Eric Lippmann
9ce2cff5c0 Introduce WaiterFunc type
The WaiterFunc type is an adapter to allow the use of ordinary
functions as Waiter.
2021-09-23 09:37:31 +02:00
Eric Lippmann
adcf9a6cfd Add EntityFactoryFunc.WithInit() 2021-04-27 23:33:49 +02:00
Alexander A. Klimov
9aa1070db0 Introduce contracts.TableNamer 2021-04-12 13:28:03 +02:00
Alexander A. Klimov
4e87ca6de3 DB#Upsert(): allow to update not all columns 2021-04-12 13:28:03 +02:00
Alexander A. Klimov
ecf3dd74ae Make NameCiMeta an Initer 2021-03-12 10:55:09 +01:00
Eric Lippmann
5f5028e637 Add contracts
This commit introduces the abstract type Entity and related components.
Entity has to be implemented by all types that Icinga DB should
synchronize.
2021-03-03 15:19:55 +01:00