1.8 KiB

Documentation

These files are generated using the swaggo/swag tool.

There are two steps, first generating the docs and then running the web server.

  1. Build the docs
    docker compose build
    
  2. Serve the docs
    docker compose up
    
  3. Go to http://127.0.0.1:8080/swagger/index.html to view the docs

Locally

Install go.

Generating the docs

  1. Set the current working dir to src
    cd src
    
  2. Run swag to generate the docs
    • Option 1, via go
      go run github.com/swaggo/swag/cmd/swag@v1.16.6 init --requiredByDefault --outputTypes "go,json"
      
    • Option 2, directly with swag
      swag init --requiredByDefault --outputTypes "go,json"
      
    • Option 3, swag via docker
      docker run --rm -v $(pwd):/code ghcr.io/swaggo/swag:latest init --requiredByDefault --outputTypes "go,json"
      
  3. Set the current working dir to src/docs
    cd docs
    
  4. Add the signal-cli receive V1 schemas

Run the web server

Run the web server to visualize the generated docs.

  1. Navigate to the src folder
    cd src
    
  2. Run the main script
    go run main.go
    
  3. Go to http://127.0.0.1:8080/swagger/index.html