added PackageList struct to common

main
Johannes Bülow 2023-10-26 13:59:10 +02:00
parent 7ea813e74a
commit f31aa197ca
Signed by untrusted user who does not match committer: jmb
GPG Key ID: B56971CF7B8F83A6
4 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package common package common
// OSInfo gives some basic information about the system.
type OSInfo struct { type OSInfo struct {
OS string OS string
Distribution string Distribution string
@ -10,6 +11,7 @@ type OSInfo struct {
PackageManager string PackageManager string
} }
// ListPackage is a single package and the information about it
type ListPackage struct { type ListPackage struct {
Name string Name string
Source string Source string
@ -20,5 +22,9 @@ type ListPackage struct {
PackageManager string PackageManager string
} }
// PackageList holds a list of ListPackages and some additional metadata
type PackageList struct { type PackageList struct {
Hostname string
Date int64
List []ListPackage
} }

View File

@ -1,7 +1,8 @@
package endpoint package endpoint
import "github.com/gin-gonic/gin" import "github.com/gin-gonic/gin"
import "git.jmbit.de/jmb/patchman/common"
func PackageList(c *gin.Context) { func PackageList(c *gin.Context) {
var packageList common.PackageList
} }

View File

@ -3,6 +3,7 @@ module git.jmbit.de/jmb/patchman/server
go 1.21.3 go 1.21.3
require ( require (
git.jmbit.de/jmb/patchman/common v0.0.0-20231026115429-7ea813e74a3f
github.com/gin-gonic/gin v1.9.1 github.com/gin-gonic/gin v1.9.1
github.com/spf13/viper v1.17.0 github.com/spf13/viper v1.17.0
) )

View File

@ -36,6 +36,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.jmbit.de/jmb/patchman/common v0.0.0-20231026115429-7ea813e74a3f h1:TBGCreejem+sBB5YfM9yTzyEiNUw8uQ3WG3S9WPot6M=
git.jmbit.de/jmb/patchman/common v0.0.0-20231026115429-7ea813e74a3f/go.mod h1:kDNcep588pcLfJQ5E5iFxhceXkkBrlCOnwZylTBeVOA=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=