#1 - Created request to check newest version of the app
All checks were successful
Build / build (push) Successful in 2m35s

#2 - Added request to download the newest version of the app
#3 - Added request to check progress during sync
#4 - Now blocking all request while sync is in progress
#5 - Implemented ants for thread pooling
#6 - Changed the sync request to now only start the sync
This commit is contained in:
2025-08-23 11:36:03 +02:00
parent 0d1c69d95e
commit 806e88adeb
26 changed files with 673 additions and 675 deletions

View File

@@ -1,44 +1,131 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import "github.com/swaggo/swag"
import (
"bytes"
"encoding/json"
"strings"
"text/template"
const docTemplate = `{
"github.com/swaggo/swag"
)
var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Sebastian Olsson",
"email": "zarnor91@gmail.com"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {}
"paths": {
"/version": {
"get": {
"description": "get string by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"accounts"
],
"summary": "Getting the version of the backend",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/backend.VersionData"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"backend.VersionData": {
"type": "object",
"properties": {
"changelog": {
"type": "string",
"example": "account name"
},
"history": {
"type": "array",
"items": {
"$ref": "#/definitions/backend.VersionData"
}
},
"version": {
"type": "string",
"example": "1.0.0"
}
}
}
}
}`
type swaggerInfo struct {
Version string
Host string
BasePath string
Schemes []string
Title string
Description string
}
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "0.5",
Host: "localhost:8080",
BasePath: "",
Schemes: []string{},
Title: "Swagger Example API",
Description: "This is a sample server Petstore server.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
var SwaggerInfo = swaggerInfo{
Version: "",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "",
Description: "",
}
type s struct{}
func (s *s) ReadDoc() string {
sInfo := SwaggerInfo
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
t, err := template.New("swagger_info").Funcs(template.FuncMap{
"marshal": func(v interface{}) string {
a, _ := json.Marshal(v)
return string(a)
},
"escape": func(v interface{}) string {
// escape tabs
str := strings.Replace(v.(string), "\t", "\\t", -1)
// replace " with \", and if that results in \\", replace that with \\\"
str = strings.Replace(str, "\"", "\\\"", -1)
return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
},
}).Parse(doc)
if err != nil {
return doc
}
var tpl bytes.Buffer
if err := t.Execute(&tpl, sInfo); err != nil {
return doc
}
return tpl.String()
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
swag.Register("swagger", &s{})
}

View File

@@ -1,19 +1,58 @@
{
"swagger": "2.0",
"info": {
"description": "This is a sample server Petstore server.",
"title": "Swagger Example API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Sebastian Olsson",
"email": "zarnor91@gmail.com"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "0.5"
"contact": {}
},
"host": "localhost:8080",
"paths": {}
"paths": {
"/version": {
"get": {
"description": "get string by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"accounts"
],
"summary": "Getting the version of the backend",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/backend.VersionData"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"backend.VersionData": {
"type": "object",
"properties": {
"changelog": {
"type": "string",
"example": "account name"
},
"history": {
"type": "array",
"items": {
"$ref": "#/definitions/backend.VersionData"
}
},
"version": {
"type": "string",
"example": "1.0.0"
}
}
}
}
}

View File

@@ -1,14 +1,37 @@
host: localhost:8080
definitions:
backend.VersionData:
properties:
changelog:
example: account name
type: string
history:
items:
$ref: '#/definitions/backend.VersionData'
type: array
version:
example: 1.0.0
type: string
type: object
info:
contact:
email: zarnor91@gmail.com
name: Sebastian Olsson
description: This is a sample server Petstore server.
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: http://swagger.io/terms/
title: Swagger Example API
version: "0.5"
paths: {}
contact: {}
paths:
/version:
get:
consumes:
- application/json
description: get string by ID
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/backend.VersionData'
"404":
description: Not Found
schema:
type: string
summary: Getting the version of the backend
tags:
- accounts
swagger: "2.0"