Skip to content

Commit 9adeae6

Browse files
author
Alban Siffer
committed
basic api update with new version
1 parent b76a61e commit 9adeae6

File tree

9 files changed

+564
-84
lines changed

9 files changed

+564
-84
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,6 @@ portable_service: build_netspot
199199
--format=tar \
200200
--compress \
201201
--image-id=netspot \
202-
--package=libpcap
202+
--package=libpcap \
203+
--package=libpcap-devel
203204

api/docs/docs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ type swaggerInfo struct {
264264

265265
// SwaggerInfo holds exported Swagger Info so clients can modify it
266266
var SwaggerInfo = swaggerInfo{
267-
Version: "2.1",
267+
Version: "2.1.1",
268268
Host: "localhost:11000",
269269
BasePath: "/api",
270270
Schemes: []string{"http"},

api/docs/swagger.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"name": "GPLv3",
1616
"url": "https://www.gnu.org/licenses/gpl-3.0.en.html"
1717
},
18-
"version": "2.1"
18+
"version": "2.1.1"
1919
},
2020
"host": "localhost:11000",
2121
"basePath": "/api",

api/docs/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ info:
1717
url: https://www.gnu.org/licenses/gpl-3.0.en.html
1818
termsOfService: http://swagger.io/terms/
1919
title: Netspot API
20-
version: "2.1"
20+
version: 2.1.1
2121
paths:
2222
/config:
2323
get:

api/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func initSubpackages() error {
142142
// ========================================================================== //
143143

144144
// @title Netspot API
145-
// @version 2.1
145+
// @version 2.1.1
146146
// @description Netspot as a service
147147
// @termsOfService http://swagger.io/terms/
148148
// @contact.name API Support

api/run.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package api
44

55
import (
66
"encoding/json"
7+
"fmt"
78
"io/ioutil"
89
"net/http"
910

@@ -17,14 +18,15 @@ import (
1718
// @Summary Manage the IDS status
1819
// @Description Use this path to start/stop the IDS
1920
// @Accept json
20-
// @Produce json
21+
// @Produce json
2122
// @Param action body string false "the action to perform" Enums("start", "stop")
2223
// @Success 200 {string} string "Comment about the action performed"
2324
// @Failure 400 {object} apiError "Error message"
2425
// @Router /run [post]
2526
func RunHandler(w http.ResponseWriter, r *http.Request) {
2627
// read content
2728
raw, err := ioutil.ReadAll(r.Body)
29+
fmt.Println("RAW:", string(raw))
2830
if err != nil {
2931
apiLogger.Error().Msg(err.Error())
3032
w.WriteHeader(http.StatusInternalServerError)

go.mod

+39-25
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,61 @@ require (
77
github.com/asiffer/gospot v0.0.0-20210118081758-b7809e99d755
88
github.com/google/gopacket v1.1.19
99
github.com/gorilla/mux v1.8.0
10+
github.com/gorilla/websocket v1.4.2
1011
github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab
11-
github.com/knadh/koanf v1.2.1
12-
github.com/pelletier/go-toml v1.9.3
13-
github.com/rs/zerolog v1.23.0
14-
github.com/spf13/viper v1.8.1
15-
github.com/swaggo/http-swagger v1.1.1
16-
github.com/swaggo/swag v1.7.1
12+
github.com/knadh/koanf v1.3.3
13+
github.com/pelletier/go-toml v1.9.4
14+
github.com/rs/zerolog v1.26.1
15+
github.com/spf13/viper v1.10.1
16+
github.com/swaggo/http-swagger v1.1.2
17+
github.com/swaggo/swag v1.7.8
1718
github.com/urfave/cli/v2 v2.3.0
1819
)
1920

2021
require (
22+
cloud.google.com/go v0.99.0 // indirect
23+
cloud.google.com/go/storage v1.14.0 // indirect
2124
github.com/KyleBanks/depth v1.2.1 // indirect
2225
github.com/PuerkitoBio/purell v1.1.1 // indirect
2326
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
24-
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
25-
github.com/fsnotify/fsnotify v1.4.9 // indirect
27+
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
28+
github.com/fsnotify/fsnotify v1.5.1 // indirect
2629
github.com/go-openapi/jsonpointer v0.19.5 // indirect
27-
github.com/go-openapi/jsonreference v0.19.5 // indirect
28-
github.com/go-openapi/spec v0.20.3 // indirect
29-
github.com/go-openapi/swag v0.19.14 // indirect
30+
github.com/go-openapi/jsonreference v0.19.6 // indirect
31+
github.com/go-openapi/spec v0.20.4 // indirect
32+
github.com/go-openapi/swag v0.19.15 // indirect
33+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
34+
github.com/golang/protobuf v1.5.2 // indirect
35+
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
36+
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 // indirect
3037
github.com/hashicorp/hcl v1.0.0 // indirect
3138
github.com/josharian/intern v1.0.0 // indirect
3239
github.com/magiconair/properties v1.8.5 // indirect
33-
github.com/mailru/easyjson v0.7.6 // indirect
40+
github.com/mailru/easyjson v0.7.7 // indirect
3441
github.com/mitchellh/copystructure v1.2.0 // indirect
35-
github.com/mitchellh/mapstructure v1.4.1 // indirect
42+
github.com/mitchellh/mapstructure v1.4.3 // indirect
3643
github.com/mitchellh/reflectwalk v1.0.2 // indirect
37-
github.com/russross/blackfriday/v2 v2.0.1 // indirect
38-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
39-
github.com/spf13/afero v1.6.0 // indirect
40-
github.com/spf13/cast v1.3.1 // indirect
44+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
45+
github.com/spf13/afero v1.7.0 // indirect
46+
github.com/spf13/cast v1.4.1 // indirect
4147
github.com/spf13/jwalterweatherman v1.1.0 // indirect
4248
github.com/spf13/pflag v1.0.5 // indirect
4349
github.com/subosito/gotenv v1.2.0 // indirect
44-
github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14 // indirect
45-
golang.org/x/exp v0.0.0-20201229011636-eab1b5eb1a03 // indirect
46-
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
47-
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect
48-
golang.org/x/text v0.3.5 // indirect
49-
golang.org/x/tools v0.1.2 // indirect
50-
gonum.org/v1/gonum v0.8.2 // indirect
51-
gopkg.in/ini.v1 v1.62.0 // indirect
50+
github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 // indirect
51+
go.opencensus.io v0.23.0 // indirect
52+
golang.org/x/exp v0.0.0-20211221223016-e29036178569 // indirect
53+
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
54+
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
55+
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
56+
golang.org/x/text v0.3.7 // indirect
57+
golang.org/x/tools v0.1.8 // indirect
58+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
59+
gonum.org/v1/gonum v0.9.3 // indirect
60+
google.golang.org/api v0.63.0 // indirect
61+
google.golang.org/appengine v1.6.7 // indirect
62+
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
63+
google.golang.org/grpc v1.43.0 // indirect
64+
google.golang.org/protobuf v1.27.1 // indirect
65+
gopkg.in/ini.v1 v1.66.2 // indirect
5266
gopkg.in/yaml.v2 v2.4.0 // indirect
5367
)

0 commit comments

Comments
 (0)