-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: doc added * added some architecture docs * updated architecture diagram * adding README badges * removing invalid group definitions from test yamls * added description about actions
- Loading branch information
Showing
12 changed files
with
1,638 additions
and
878 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Actions | ||
|
||
Actions are the results of the `globalregistry.reconciler/Compare` function when | ||
the expected and actual registry state are compared. Actions describe the | ||
operations that are to be performed on the registry to reach the actual state. | ||
Action is defined as an interface: | ||
|
||
``` go | ||
type Action interface { | ||
String() string | ||
Perform(globalregistry.Registry) (SideEffect, error) | ||
} | ||
``` | ||
|
||
An action has a string representation via the `String` method and and action can | ||
be executed via the `Perform` method. | ||
|
||
Examples for action implementation are: | ||
|
||
* creating a project | ||
* removing a member from a project | ||
* assign a scanner to a project, etc. | ||
|
||
# SideEffects | ||
|
||
On one hand Actions can succeed or fail, which is reflected in the returned | ||
error. On the other hand, Actions may require further operations to be performed | ||
which are not related to the registry. For example a file shall be stored in the | ||
local file system. Such an operation is implemented as a SideEffect, which is | ||
created when an Action is performed. | ||
|
||
A SideEffect is an interface too: | ||
|
||
``` go | ||
type SideEffect interface { | ||
Perform(ctx context.Context) error | ||
} | ||
``` | ||
|
||
The parameters of the SideEffect shall be encapsulated into the `ctx` parameter | ||
of the `Perform` method. | ||
|
||
The `globalregistry/reconciler` package implements a `nilEffect` variable that | ||
can be used as a no-op SideEffect. | ||
|
||
<!-- Local Variables: --> | ||
<!-- mode: gfm --> | ||
<!-- End: --> |
Oops, something went wrong.