Moved to go 1.22 net/http

This commit is contained in:
2024-04-02 20:34:59 -05:00
parent 97b4c60096
commit 7c1a319b55
13 changed files with 239 additions and 446 deletions

View File

@@ -1,5 +1,4 @@
// Code generated by swaggo/swag. DO NOT EDIT.
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
@@ -25,8 +24,13 @@ const docTemplate = `{
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/health/getHealth": {
"/health/gethealth": {
"get": {
"security": [
{
"Authorization": []
}
],
"description": "Get the health of the API",
"consumes": [
"application/json"
@@ -45,7 +49,7 @@ const docTemplate = `{
"$ref": "#/definitions/model.Message"
}
},
"400": {
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
@@ -230,35 +234,6 @@ const docTemplate = `{
}
}
}
},
"/unraid/powerusage": {
"get": {
"description": "Gets the PSU Data from unraid",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"unraid"
],
"summary": "Unraid PSU Stats",
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/model.PowerSupply"
}
},
"412": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
}
}
},
"definitions": {
@@ -270,72 +245,10 @@ const docTemplate = `{
"example": "message"
}
}
},
"model.PowerSupply": {
"type": "object",
"properties": {
"12v_load": {
"type": "integer"
},
"12v_watts": {
"type": "integer"
},
"3v_load": {
"type": "integer"
},
"3v_watts": {
"type": "integer"
},
"5v_load": {
"type": "integer"
},
"5v_watts": {
"type": "integer"
},
"capacity": {
"type": "string"
},
"efficiency": {
"type": "integer"
},
"fan_rpm": {
"type": "integer"
},
"load": {
"type": "integer"
},
"poweredon": {
"type": "string"
},
"poweredon_raw": {
"type": "string"
},
"product": {
"type": "string"
},
"temp1": {
"type": "integer"
},
"temp2": {
"type": "integer"
},
"uptime": {
"type": "string"
},
"uptime_raw": {
"type": "string"
},
"vendor": {
"type": "string"
},
"watts": {
"type": "integer"
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"Authorization": {
"type": "apiKey",
"name": "Authorization",
"in": "header"

View File

@@ -16,8 +16,13 @@
},
"basePath": "/api",
"paths": {
"/health/getHealth": {
"/health/gethealth": {
"get": {
"security": [
{
"Authorization": []
}
],
"description": "Get the health of the API",
"consumes": [
"application/json"
@@ -36,7 +41,7 @@
"$ref": "#/definitions/model.Message"
}
},
"400": {
"500": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
@@ -221,35 +226,6 @@
}
}
}
},
"/unraid/powerusage": {
"get": {
"description": "Gets the PSU Data from unraid",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"unraid"
],
"summary": "Unraid PSU Stats",
"responses": {
"200": {
"description": "response",
"schema": {
"$ref": "#/definitions/model.PowerSupply"
}
},
"412": {
"description": "error",
"schema": {
"$ref": "#/definitions/model.Message"
}
}
}
}
}
},
"definitions": {
@@ -261,72 +237,10 @@
"example": "message"
}
}
},
"model.PowerSupply": {
"type": "object",
"properties": {
"12v_load": {
"type": "integer"
},
"12v_watts": {
"type": "integer"
},
"3v_load": {
"type": "integer"
},
"3v_watts": {
"type": "integer"
},
"5v_load": {
"type": "integer"
},
"5v_watts": {
"type": "integer"
},
"capacity": {
"type": "string"
},
"efficiency": {
"type": "integer"
},
"fan_rpm": {
"type": "integer"
},
"load": {
"type": "integer"
},
"poweredon": {
"type": "string"
},
"poweredon_raw": {
"type": "string"
},
"product": {
"type": "string"
},
"temp1": {
"type": "integer"
},
"temp2": {
"type": "integer"
},
"uptime": {
"type": "string"
},
"uptime_raw": {
"type": "string"
},
"vendor": {
"type": "string"
},
"watts": {
"type": "integer"
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"Authorization": {
"type": "apiKey",
"name": "Authorization",
"in": "header"

View File

@@ -6,47 +6,6 @@ definitions:
example: message
type: string
type: object
model.PowerSupply:
properties:
3v_load:
type: integer
3v_watts:
type: integer
5v_load:
type: integer
5v_watts:
type: integer
12v_load:
type: integer
12v_watts:
type: integer
capacity:
type: string
efficiency:
type: integer
fan_rpm:
type: integer
load:
type: integer
poweredon:
type: string
poweredon_raw:
type: string
product:
type: string
temp1:
type: integer
temp2:
type: integer
uptime:
type: string
uptime_raw:
type: string
vendor:
type: string
watts:
type: integer
type: object
info:
contact:
email: developerdurp@durp.info
@@ -59,7 +18,7 @@ info:
termsOfService: http://swagger.io/terms/
title: DurpAPI
paths:
/health/getHealth:
/health/gethealth:
get:
consumes:
- application/json
@@ -71,10 +30,12 @@ paths:
description: response
schema:
$ref: '#/definitions/model.Message'
"400":
"500":
description: error
schema:
$ref: '#/definitions/model.Message'
security:
- Authorization: []
summary: Generate Health status
tags:
- health
@@ -195,27 +156,8 @@ paths:
summary: Travel Agent ChatGPT
tags:
- openai
/unraid/powerusage:
get:
consumes:
- application/json
description: Gets the PSU Data from unraid
produces:
- application/json
responses:
"200":
description: response
schema:
$ref: '#/definitions/model.PowerSupply'
"412":
description: error
schema:
$ref: '#/definitions/model.Message'
summary: Unraid PSU Stats
tags:
- unraid
securityDefinitions:
ApiKeyAuth:
Authorization:
in: header
name: Authorization
type: apiKey