https://mermaid.js.org/
https://mermaid.live/
---
title: Sequence Diagram example
---
sequenceDiagram
autonumber
participant cl AS Client
echo -ne "Getting the TLS entries from 1Password... ⌛\r" | |
sleep 2 # Simulate some processing | |
echo -ne "Getting the TLS entries from 1Password... ✅\n" | |
# -n prevents echo from automatically adding a newline. | |
# -e enables interpretation of escape sequences like \r (carriage return). | |
# \r moves the cursor back to the start of the line, so the next echo overwrites it. | |
# The final \n ensures the cursor moves to a new line after displaying the ✅. |
https://mermaid.js.org/
https://mermaid.live/
---
title: Sequence Diagram example
---
sequenceDiagram
autonumber
participant cl AS Client
Create a new directory for your project.
Inside the directory git clone
your projects.
Next, from within the project directory (where the individual projects are cloned within), create your go.work
file.
You can do this in one of two ways:
go work init ./cli ./go-fastly
# update --cursor value to acquire all the relevant domain data (see batch-identify-domains.sh) | |
fastly domain-v1 list --fqdn=test-tf --cursor=<REDACTED> --limit=100 --json | jq -r .data[].id >> /tmp/delete-domains | |
# now delete all those items | |
cat /tmp/delete-domains | xargs -P "$(sysctl -n hw.ncpu)" -I % fastly domain-v1 delete --domain-id=% |
I don't know if this actually works but apparently you can use a discriminator like this...
Note
In this example, your API has to return a type
property that might have a value like "base"
or "feature_x"
.
If the API response contains "type": "base"
, then the OpenAPI schema will use the BaseResponse
schema.
Otherwise, if it's "type": "feature_x"
, the OpenAPI schema will use the eatureXResponse
schema.
openapi: 3.1.0
Tip
For a real-world example see [this gist][real-world].
errgroup.Group
in Go is a great way to manage concurrent goroutines that return errors. It simplifies error handling and ensures that all goroutines finish or exit if any one of them fails. However, there are specific scenarios where it shines and others where it might not be the best fit.
errgroup
helps manage their lifecycle.You need to install Hammerspoon and setup a ~/.hammerspoon/init.lua
.
Examples can be found here: https://www.hammerspoon.org/go/#helloworld
brew install imagemagick | |
magick example.png -quality 70 optimised.jpg |