Skip to content

Commit

Permalink
Merge pull request #49 from sudoblockio/fix/doc-string-for-stats
Browse files Browse the repository at this point in the history
fix: update doc string for stats
  • Loading branch information
shreyasbhat0 authored Oct 15, 2024
2 parents 1c96e0d + 8d0d7fb commit f966e72
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 75 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,13 @@ jobs:
max-parallel: 1
matrix:
include:
- cluster: prod-sng
- cluster: prod-ams
network_name: mainnet
network_version: v2
- cluster: prod-sng
network_name: sejong
network_version: v2
- cluster: prod-sng
- cluster: prod-ams
network_name: lisbon
network_version: v2
- cluster: prod-sng
- cluster: prod-ams
network_name: berlin
network_version: v2

Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,13 @@ jobs:
max-parallel: 1
matrix:
include:
- cluster: prod-ams
- cluster: prod-sng
network_name: mainnet
network_version: v2
- cluster: prod-ams
network_name: sejong
network_version: v2
- cluster: prod-ams
- cluster: prod-sng
network_name: lisbon
network_version: v2
- cluster: prod-ams
- cluster: prod-sng
network_name: berlin
network_version: v2

Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
test: up-dbs test-unit test-integration

up-dbs: ## Bring up the DBs
docker-compose -f docker-compose.db.yml up -d
docker compose -f docker-compose.db.yml up -d
echo "Waiting for backend to populate some records..."
sleep 10

down-dbs: ## Take down the DBs
docker-compose -f docker-compose.db.yml down
docker compose -f docker-compose.db.yml down

test-unit: ## Run unit tests - Need DB compose up
cd src && go test ./... -v --tags=unit
Expand All @@ -22,13 +22,13 @@ test-coverage: up-dbs ## Run unit tests - Need DB compose up
cd src && go test ./... -v -race -covermode=atomic -coverprofile=../coverage.out

pull:
docker-compose -f docker-compose.db.yml -f docker-compose.yml pull
docker compose -f docker-compose.db.yml -f docker-compose.yml pull

up: ## Bring everything up as containers
docker-compose -f docker-compose.db.yml -f docker-compose.yml up -d
docker compose -f docker-compose.db.yml -f docker-compose.yml up -d

down: ## Take down all the containers
docker-compose -f docker-compose.db.yml -f docker-compose.yml down -v
docker compose -f docker-compose.db.yml -f docker-compose.yml down -v

clean:
docker volume rm $(docker volume ls -q)
Expand All @@ -37,16 +37,16 @@ build-swagger: ## Build the swagger docs
cd src/api && bash generateSwagDocs.sh

build: ## Build everything
docker-compose build
docker compose build

ps: ## List all containers and running status
docker-compose -f docker-compose.db.yml -f docker-compose.yml ps
docker compose -f docker-compose.db.yml -f docker-compose.yml ps

postgres-console: ## Start postgres terminal
docker-compose -f docker-compose.db.yml -f docker-compose.yml exec postgres psql -U postgres
docker compose -f docker-compose.db.yml -f docker-compose.yml exec postgres psql -U postgres

redis-console: ## Start redis terminal
docker-compose -f docker-compose.db.yml -f docker-compose.yml exec redis redis-cli
docker compose -f docker-compose.db.yml -f docker-compose.yml exec redis redis-cli

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'
8 changes: 4 additions & 4 deletions src/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ func Start() *fiber.App {
}

// Version
// @Summary Show the status of server.
// @Description get the status of server.
// @Summary Show the version of server.
// @Description get the version of server.
// @Tags Version
// @Accept */*
// @Produce json
Expand All @@ -95,8 +95,8 @@ func handlerVersion(c *fiber.Ctx) error {
}

// Metadata
// @Summary Show the status of server.
// @Description get the status of server.
// @Summary Show the metadata of server.
// @Description get the metadata of server.
// @Tags Version
// @Accept */*
// @Produce json
Expand Down
35 changes: 18 additions & 17 deletions src/api/docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs

import "github.com/swaggo/swag"

const docTemplate_swagger = `{
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
Expand Down Expand Up @@ -544,7 +543,7 @@ const docTemplate_swagger = `{
"tags": [
"Stats"
],
"summary": "Get Stats",
"summary": "Get Circulating Supply",
"responses": {
"200": {
"description": "OK",
Expand All @@ -571,7 +570,7 @@ const docTemplate_swagger = `{
"tags": [
"Stats"
],
"summary": "Get Stats",
"summary": "Get Market Cap",
"responses": {
"200": {
"description": "OK",
Expand All @@ -598,7 +597,7 @@ const docTemplate_swagger = `{
"tags": [
"Stats"
],
"summary": "Get Stats",
"summary": "Get Total Supply",
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -653,7 +652,7 @@ const docTemplate_swagger = `{
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"summary": "Get Circulating Supply",
"responses": {
"200": {
"description": "OK",
Expand All @@ -680,7 +679,7 @@ const docTemplate_swagger = `{
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"summary": "Get Market Cap",
"responses": {
"200": {
"description": "OK",
Expand All @@ -707,7 +706,7 @@ const docTemplate_swagger = `{
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"summary": "Get Total Supply",
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -1428,7 +1427,7 @@ const docTemplate_swagger = `{
},
"/metadata": {
"get": {
"description": "get the status of server.",
"description": "get the metadata of server.",
"consumes": [
"*/*"
],
Expand All @@ -1438,7 +1437,7 @@ const docTemplate_swagger = `{
"tags": [
"Version"
],
"summary": "Show the status of server.",
"summary": "Show the metadata of server.",
"responses": {
"200": {
"description": "OK",
Expand All @@ -1452,7 +1451,7 @@ const docTemplate_swagger = `{
},
"/version": {
"get": {
"description": "get the status of server.",
"description": "get the version of server.",
"consumes": [
"*/*"
],
Expand All @@ -1462,7 +1461,7 @@ const docTemplate_swagger = `{
"tags": [
"Version"
],
"summary": "Show the status of server.",
"summary": "Show the version of server.",
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -1970,18 +1969,20 @@ const docTemplate_swagger = `{
}
}`

// SwaggerInfo_swagger holds exported Swagger Info so clients can modify it
var SwaggerInfo_swagger = &swag.Spec{
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "2.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "Icon Go API",
Description: "The icon tracker API",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate_swagger,
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {
swag.Register(SwaggerInfo_swagger.InstanceName(), SwaggerInfo_swagger)
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
20 changes: 10 additions & 10 deletions src/api/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
"tags": [
"Stats"
],
"summary": "Get Stats",
"summary": "Get Circulating Supply",
"responses": {
"200": {
"description": "OK",
Expand All @@ -562,7 +562,7 @@
"tags": [
"Stats"
],
"summary": "Get Stats",
"summary": "Get Market Cap",
"responses": {
"200": {
"description": "OK",
Expand All @@ -589,7 +589,7 @@
"tags": [
"Stats"
],
"summary": "Get Stats",
"summary": "Get Total Supply",
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -644,7 +644,7 @@
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"summary": "Get Circulating Supply",
"responses": {
"200": {
"description": "OK",
Expand All @@ -671,7 +671,7 @@
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"summary": "Get Market Cap",
"responses": {
"200": {
"description": "OK",
Expand All @@ -698,7 +698,7 @@
"tags": [
"Supplies"
],
"summary": "Get Supplies",
"summary": "Get Total Supply",
"responses": {
"200": {
"description": "OK",
Expand Down Expand Up @@ -1419,7 +1419,7 @@
},
"/metadata": {
"get": {
"description": "get the status of server.",
"description": "get the metadata of server.",
"consumes": [
"*/*"
],
Expand All @@ -1429,7 +1429,7 @@
"tags": [
"Version"
],
"summary": "Show the status of server.",
"summary": "Show the metadata of server.",
"responses": {
"200": {
"description": "OK",
Expand All @@ -1443,7 +1443,7 @@
},
"/version": {
"get": {
"description": "get the status of server.",
"description": "get the version of server.",
"consumes": [
"*/*"
],
Expand All @@ -1453,7 +1453,7 @@
"tags": [
"Version"
],
"summary": "Show the status of server.",
"summary": "Show the version of server.",
"responses": {
"200": {
"description": "OK",
Expand Down
Loading

0 comments on commit f966e72

Please sign in to comment.