Skip to content

Commit ed54e7d

Browse files
committed
Split handling of indexes and tools in v2
1 parent a9f12ec commit ed54e7d

33 files changed

+1922
-145
lines changed

design/pkgs.go

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
package design
2+
3+
import . "goa.design/goa/dsl"
4+
5+
var _ = Service("indexes", func() {
6+
Description("The indexes service manages the package_index files")
7+
8+
Method("list", func() {
9+
Result(ArrayOf(String))
10+
HTTP(func() {
11+
GET("/pkgs/indexes")
12+
Response(StatusOK)
13+
})
14+
})
15+
16+
Method("add", func() {
17+
HTTP(func() {
18+
PUT("/pkgs/indexes/:id")
19+
Response(StatusOK)
20+
})
21+
})
22+
23+
Method("remove", func() {
24+
HTTP(func() {
25+
DELETE("/pkgs/indexes/:id")
26+
Response(StatusOK)
27+
})
28+
})
29+
})
30+
31+
var _ = Service("tools", func() {
32+
Description("The tools service manages the available and installed tools")
33+
34+
Method("available", func() {
35+
Result(CollectionOf(Tool))
36+
HTTP(func() {
37+
GET("/pkgs/tools/available")
38+
Response(StatusOK)
39+
})
40+
})
41+
42+
Method("installed", func() {
43+
Result(CollectionOf(Tool))
44+
HTTP(func() {
45+
GET("/pkgs/tools/installed")
46+
Response(StatusOK)
47+
})
48+
})
49+
50+
Method("install", func() {
51+
Payload(ToolPayload)
52+
HTTP(func() {
53+
PUT("/pkgs/tools/installed")
54+
Response(StatusOK)
55+
})
56+
})
57+
58+
Method("remove", func() {
59+
HTTP(func() {
60+
DELETE("/pkgs/tools/installed/:id")
61+
Response(StatusOK)
62+
})
63+
})
64+
})
65+
66+
var ToolPayload = Type("arduino.tool", func() {
67+
Description("A tool is an executable program that can upload sketches.")
68+
TypeName("ToolPayload")
69+
70+
Attribute("name", String, "The name of the tool", func() {
71+
Example("avrdude")
72+
})
73+
Attribute("version", String, "The version of the tool", func() {
74+
Example("6.3.0-arduino9")
75+
})
76+
Attribute("packager", String, "The packager of the tool", func() {
77+
Example("arduino")
78+
})
79+
80+
Required("name", "version", "packager")
81+
})
82+
83+
var Tool = ResultType("application/vnd.arduino.tool", func() {
84+
Description("A tool is an executable program that can upload sketches.")
85+
TypeName("Tool")
86+
Reference(ToolPayload)
87+
88+
Attribute("name")
89+
Attribute("version")
90+
Attribute("packager")
91+
92+
Required("name", "version", "packager")
93+
})

design/tools.go

-33
This file was deleted.

gen/http/cli/arduino_create_agent/cli.go

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

0 commit comments

Comments
 (0)