Skip to content

Commit b8c59a7

Browse files
[breaking] Remove indexes v2 endpoint (#838)
* remove indexes endpoint, since it's not used run `goa gen github.com/arduino/arduino-create-agent/design` * remove v2 index logic * removed useless API level code * factor out index handling of the index to a separate package the `.arduino-create` dir is now created by the `index.Init()` func * make the IndexReasource a pointer so that it can be shared * pass the shared Index structure to the goa Server * allow the tools endpoint to install and list available tools from default package_index.json only and fix/adapt tests * add test * rename to Resource * `go mod tidy` * factor out index download logic Co-authored-by: Alessio Perugini <[email protected]> * always download the index the first time Co-authored-by: Alessio Perugini <[email protected]> * make pkgs.Tools struct properties unexported and use "constructor" * make tools.Tools struct properties unexported and use a "constructor" * increment delay for the test startup --------- Co-authored-by: Alessio Perugini <[email protected]>
1 parent bf32bad commit b8c59a7

38 files changed

+393
-2782
lines changed

.licenses/arduino-create-agent/go/go.bug.st/downloader/v2.dep.yml

-44
This file was deleted.

design/pkgs.go

-44
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,6 @@ package design
1717

1818
import . "goa.design/goa/v3/dsl"
1919

20-
var _ = Service("indexes", func() {
21-
Description("The indexes service manages the package_index files")
22-
23-
Error("invalid_url", ErrorResult, "url invalid")
24-
HTTP(func() {
25-
Response("invalid_url", StatusBadRequest)
26-
})
27-
28-
Method("list", func() {
29-
Result(ArrayOf(String))
30-
HTTP(func() {
31-
GET("/pkgs/indexes")
32-
Response(StatusOK)
33-
})
34-
})
35-
36-
Method("add", func() {
37-
Payload(IndexPayload)
38-
Result(Operation)
39-
HTTP(func() {
40-
POST("/pkgs/indexes/add")
41-
Response(StatusOK)
42-
})
43-
})
44-
45-
Method("remove", func() {
46-
Payload(IndexPayload)
47-
Result(Operation)
48-
HTTP(func() {
49-
POST("/pkgs/indexes/delete")
50-
Response(StatusOK)
51-
})
52-
})
53-
})
54-
5520
var _ = Service("tools", func() {
5621
Description("The tools service manages the available and installed tools")
5722

@@ -95,15 +60,6 @@ var _ = Service("tools", func() {
9560
})
9661
})
9762

98-
var IndexPayload = Type("arduino.index", func() {
99-
TypeName("IndexPayload")
100-
101-
Attribute("url", String, "The url of the index file", func() {
102-
Example("https://downloads.arduino.cc/packages/package_index.json")
103-
})
104-
Required("url")
105-
})
106-
10763
var ToolPayload = Type("arduino.tool", func() {
10864
Description(`A tool is an executable program that can upload sketches.
10965
If url is absent the tool will be searched among the package index installed`)

gen/http/cli/arduino_create_agent/cli.go

+2-99
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/http/indexes/client/cli.go

-51
This file was deleted.

0 commit comments

Comments
 (0)