-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added check if output folder exists then prompts for if it should be repalced * refactored function out of main * load data into .env file, write multiple templates, tree structure in template folder, service reads .env file * splitted model and helper functions into own folders * moved utils into correct folder * removed unneeded log * completed merge * fixed bug with some producer handlers not being created * made publish handlers more usable * corrected path * fix * added simple cli to microservice * clippy * fixed streams compiling --------- Co-authored-by: Aro <rother@mail.tu-berlin.de>
- Loading branch information
Showing
23 changed files
with
596 additions
and
241 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
asyncapi: '2.6.0' | ||
info: | ||
title: automatic lighting | ||
version: '1.0.0' | ||
description: | | ||
The Smartylighting Streetlights API allows you to remotely manage the city lights. | ||
### Check out its awesome features: | ||
* Turn a specific streetlight on/off 🌃 | ||
* Receive real-time information about environmental lighting conditions 📈 | ||
servers: | ||
dev: | ||
url: localhost:4022 | ||
protocol: nats | ||
description: Nats message broker | ||
channels: | ||
lightMeasured: | ||
description: The topic on which measured values may be produced and consumed. | ||
publish: | ||
summary: Inform about environmental lighting conditions of a particular streetlight. | ||
operationId: receiveLightMeasurement | ||
message: | ||
$ref: '#/components/messages/lightMeasured' | ||
turnOnStreetlight: | ||
subscribe: | ||
operationId: turnOn | ||
message: | ||
$ref: '#/components/messages/turnOnOff' | ||
turnOffStreetlight: | ||
subscribe: | ||
operationId: turnOff | ||
message: | ||
$ref: '#/components/messages/turnOnOff' | ||
components: | ||
messages: | ||
lightMeasured: | ||
name: lightMeasured | ||
title: Light measured | ||
summary: Inform about environmental lighting conditions of a particular streetlight. | ||
contentType: application/json | ||
payload: | ||
$ref: "#/components/schemas/lightMeasuredPayload" | ||
turnOnOff: | ||
name: turnOnOff | ||
title: Turn on/off | ||
summary: Command a particular streetlight to turn the lights on or off. | ||
payload: | ||
$ref: "#/components/schemas/turnOnOffPayload" | ||
schemas: | ||
lightMeasuredPayload: | ||
type: object | ||
properties: | ||
lumens: | ||
type: integer | ||
minimum: 0 | ||
description: Light intensity measured in lumens. | ||
turnOnOffPayload: | ||
type: object | ||
properties: | ||
lightId: | ||
type: string | ||
command: | ||
type: string | ||
enum: | ||
- on | ||
- off | ||
description: Whether to turn on or off the light. | ||
|
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,110 @@ | ||
asyncapi: 2.1.0 | ||
info: | ||
title: queue_and_stream_api | ||
version: 1.0.0 | ||
servers: | ||
production: | ||
url: demo.nats.io | ||
protocol: nats | ||
channels: | ||
user/signedup: | ||
subscribe: | ||
bindings: | ||
nats: | ||
x-streamname: testStream | ||
operationId: onUserSignup | ||
summary: User signup notification | ||
message: | ||
payload: | ||
type: object | ||
properties: | ||
userSingnedUp: | ||
type: string | ||
userID: | ||
type: number | ||
timestamp: | ||
type: string | ||
publish: | ||
bindings: | ||
nats: | ||
x-streamname: testStream | ||
operationId: userSignedUp | ||
summary: send welcome email to user | ||
message: | ||
payload: | ||
type: object | ||
properties: | ||
userSingnedUp: | ||
type: string | ||
userID: | ||
type: number | ||
timestamp: | ||
type: string | ||
user/buy: | ||
subscribe: | ||
bindings: | ||
nats: | ||
queue: MyQueue | ||
operationId: userBought | ||
summary: User bought something | ||
message: | ||
payload: | ||
type: object | ||
properties: | ||
userBought: | ||
type: string | ||
quantity: | ||
type: number | ||
timestamp: | ||
type: string | ||
examples: | ||
- name: simpleExample | ||
payload: | ||
userBought: "something" | ||
quantity: 1 | ||
timestamp: "2020-01-01T00:00:00Z" | ||
publish: | ||
bindings: | ||
nats: | ||
queue: MyQueue | ||
operationId: onUserBought | ||
summary: send email to user | ||
message: | ||
payload: | ||
type: object | ||
properties: | ||
userBought: | ||
type: string | ||
quantity: | ||
type: number | ||
credit: | ||
type: boolean | ||
examples: | ||
- name: secondExample | ||
payload: | ||
userBought: "something else" | ||
quantity: 3 | ||
credit: true | ||
user/sell: | ||
subscribe: | ||
operationId: userSold | ||
summary: User sold something | ||
message: | ||
payload: | ||
type: object | ||
properties: | ||
soldItem: | ||
type: string | ||
timestamp: | ||
type: string | ||
publish: | ||
operationId: onUserSold | ||
summary: send email to user | ||
message: | ||
payload: | ||
type: object | ||
properties: | ||
soldItem: | ||
type: string | ||
timestamp: | ||
type: string |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
mod common; | ||
mod model; | ||
pub use common::{ | ||
cargo_fix, cargo_fmt, cargo_generate_rustdoc, cargo_init_project, template_render_write, | ||
cargo_fix, cargo_fmt, cargo_generate_rustdoc, cargo_init_project, check_for_overwrite, | ||
template_render_write, write_multiple_templates, | ||
}; | ||
pub use model::generate_models_folder; |
Oops, something went wrong.