External packages and example CLI#4
Merged
Merged
Conversation
ab8ada7 to
f9db2b1
Compare
Merged
ceef8b3 to
1773447
Compare
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
stgraber
reviewed
Jul 27, 2022
stgraber
reviewed
Jul 27, 2022
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #3
This mainly refactors the project to expose some components so that they can be externally called from other packages.
Basically, this moves stuff out of the
internalpackage and adds top-level packages for:client- Adds a/1.0endpoint helper and helpers for querying the entire cluster at once. Creating a client is still internal, except through a few helpers in themicroclusterpackage.cluster- The generated components of the database need to be external because external calls to the generator will rely on them.rest- Exposes types for API endpoint creation. The actual handling is still internal.state- This one's a bit hacky, basically we need the external APIs to have access to the daemon's state to be able to actually do things, so this just exposes a type definition.Additionally there is now a
microclusterpackage with anAppcommand that takes some state args and interfaces with theinternalpackage to create some useful helpers for interacting with the daemon externally. This will allow passing in our own set of[]rest.Endpointandmap[int]schema.Updatethat will be appended to the/1.0endpoints and the default schema, respectively.Lastly there is an
exampledirectory with amicrod/microctlproject inside. This usesmicrocluster.Appalong with the packages above to create a basic cluster. Here is the readme.