Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Add another exemple
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasepe committed Jun 6, 2020
1 parent 9120b09 commit 931c65e
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 19 deletions.
80 changes: 61 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,34 +81,32 @@ An autogenerated `id` has a prefix and a sequential number

- the prefix is related to the component `kind`

Aautogenerated `id` prefix mapping.

| a kind of... | will generate an `id` prefix with... | examples |
|:-------------|:-------------------------------------|:---------------|
| `client` | `cl` | `cl1, cl2,...` |
| `service` | `ms` | `ms1, ms2,...` |
| `gateway` | `gt` | `gt1, gt2,...` |
| `broker` | `br` | `br1, br2,...` |
| `queue` | `qs` | `qs1, qs2,...` |
| `storage` | `st` | `st1, st2,...` |
| `function` | `fn` | `fn1, fn2,...` |
| `database` | `db` | `db1, db2,...` |
| `client` | cl | _cl1, cl2,..._ |
| `service` | ms | _ms1, ms2,..._ |
| `gateway` | gt | _gt1, gt2,..._ |
| `broker` | br | _br1, br2,..._ |
| `queue` | qs | _qs1, qs2,..._ |
| `storage` | st | _st1, st2,..._ |
| `function` | fn | _fn1, fn2,..._ |
| `database` | db | _db1, db2,..._ |

A `connection` has the following properties:

```go
type Connection struct {
Origin struct {
ComponentID string `yaml:"componentId"`
} `yaml:"origin"`
Targets []struct {
ComponentID string `yaml:"componentId"`
Label string `yaml:"label,omitempty"`
Color string `yaml:"color,omitempty"`
Dashed bool `yaml:"dashed,omitempty"`
Origin struct {
ComponentID string `yaml:"componentId"`
} `yaml:"origin"`
Targets []struct {
ComponentID string `yaml:"componentId"`
Label string `yaml:"label,omitempty"`
Color string `yaml:"color,omitempty"`
Dashed bool `yaml:"dashed,omitempty"`
Dir string `yaml:"dir,omitempty"`
Highlight bool `yaml:"highlight,omitempty"`
} `yaml:"targets"`
} `yaml:"targets"`
}
```

Expand Down Expand Up @@ -258,3 +256,47 @@ connections:
Here the generated output:

![](./examples/aws-cognito-custom-auth-flow.png)

## Example 3 - Getting the pre-signed URL to Upload a file to Amazon S3

```yaml
title: Upload file to S3 using Lambda for pre-signed URL
backgroundColor: '#ffffff'
components:
-
kind: client
label: "Web App"
provider: SPA
-
kind: gateway
provider: "AWS API Gateway"
-
kind: function
label: "Get\nPre-Signed URL"
provider: "AWS Lambda"
-
kind: storage
label: "*.jpg\n*.png"
provider: "AWS S3"
connections:
-
origin:
componentId: cl1
targets:
-
componentId: gt1
-
origin:
componentId: gt1
targets:
-
componentId: fn1
-
origin:
componentId: fn1
targets:
-
componentId: st1
```

![](./examples/s3-upload-presigned-url.png)
Binary file added examples/s3-upload-presigned-url.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions examples/s3-upload-presigned-url.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
title: Upload file to S3 using Lambda for pre-signed URL
backgroundColor: '#ffffff'
components:
-
kind: client
label: "Web App"
provider: SPA
-
kind: gateway
provider: "AWS API Gateway"
-
kind: function
label: "Get\nPre-Signed URL"
provider: "AWS Lambda"
-
kind: storage
label: "*.jpg\n*.png"
provider: "AWS S3"
connections:
-
origin:
componentId: cl1
targets:
-
componentId: gt1
-
origin:
componentId: gt1
targets:
-
componentId: fn1
-
origin:
componentId: fn1
targets:
-
componentId: st1

0 comments on commit 931c65e

Please sign in to comment.