3
3
//
4
4
// Generated with goagen v0.0.1, command line:
5
5
// $ goagen
6
- // --out=.
6
+ // --out=$(GOPATH)/src/github.com/raphael/goa/examples/cellar
7
7
// --design=github.com/raphael/goa/examples/cellar/design
8
8
// --pkg=app
9
9
//
@@ -19,6 +19,7 @@ import (
19
19
20
20
// AccountController is the controller interface for the Account actions.
21
21
type AccountController interface {
22
+ goa.Controller
22
23
Create (* CreateAccountContext ) error
23
24
Delete (* DeleteAccountContext ) error
24
25
Show (* ShowAccountContext ) error
@@ -36,7 +37,7 @@ func MountAccountController(service goa.Service, ctrl AccountController) {
36
37
}
37
38
return ctrl .Create (ctx )
38
39
}
39
- router .Handle ("POST" , "/cellar/accounts" , goa .NewHTTPRouterHandle (service , "Account" , "Create" , h ))
40
+ router .Handle ("POST" , "/cellar/accounts" , ctrl .NewHTTPRouterHandle ("Create" , h ))
40
41
service .Info ("mount" , "ctrl" , "Account" , "action" , "Create" , "route" , "POST /cellar/accounts" )
41
42
h = func (c * goa.Context ) error {
42
43
ctx , err := NewDeleteAccountContext (c )
@@ -45,7 +46,7 @@ func MountAccountController(service goa.Service, ctrl AccountController) {
45
46
}
46
47
return ctrl .Delete (ctx )
47
48
}
48
- router .Handle ("DELETE" , "/cellar/accounts/:accountID" , goa .NewHTTPRouterHandle (service , "Account" , "Delete" , h ))
49
+ router .Handle ("DELETE" , "/cellar/accounts/:accountID" , ctrl .NewHTTPRouterHandle ("Delete" , h ))
49
50
service .Info ("mount" , "ctrl" , "Account" , "action" , "Delete" , "route" , "DELETE /cellar/accounts/:accountID" )
50
51
h = func (c * goa.Context ) error {
51
52
ctx , err := NewShowAccountContext (c )
@@ -54,7 +55,7 @@ func MountAccountController(service goa.Service, ctrl AccountController) {
54
55
}
55
56
return ctrl .Show (ctx )
56
57
}
57
- router .Handle ("GET" , "/cellar/accounts/:accountID" , goa .NewHTTPRouterHandle (service , "Account" , "Show" , h ))
58
+ router .Handle ("GET" , "/cellar/accounts/:accountID" , ctrl .NewHTTPRouterHandle ("Show" , h ))
58
59
service .Info ("mount" , "ctrl" , "Account" , "action" , "Show" , "route" , "GET /cellar/accounts/:accountID" )
59
60
h = func (c * goa.Context ) error {
60
61
ctx , err := NewUpdateAccountContext (c )
@@ -63,12 +64,13 @@ func MountAccountController(service goa.Service, ctrl AccountController) {
63
64
}
64
65
return ctrl .Update (ctx )
65
66
}
66
- router .Handle ("PUT" , "/cellar/accounts/:accountID" , goa .NewHTTPRouterHandle (service , "Account" , "Update" , h ))
67
+ router .Handle ("PUT" , "/cellar/accounts/:accountID" , ctrl .NewHTTPRouterHandle ("Update" , h ))
67
68
service .Info ("mount" , "ctrl" , "Account" , "action" , "Update" , "route" , "PUT /cellar/accounts/:accountID" )
68
69
}
69
70
70
71
// BottleController is the controller interface for the Bottle actions.
71
72
type BottleController interface {
73
+ goa.Controller
72
74
Create (* CreateBottleContext ) error
73
75
Delete (* DeleteBottleContext ) error
74
76
List (* ListBottleContext ) error
@@ -88,7 +90,7 @@ func MountBottleController(service goa.Service, ctrl BottleController) {
88
90
}
89
91
return ctrl .Create (ctx )
90
92
}
91
- router .Handle ("POST" , "/cellar/accounts/:accountID/bottles" , goa .NewHTTPRouterHandle (service , "Bottle" , "Create" , h ))
93
+ router .Handle ("POST" , "/cellar/accounts/:accountID/bottles" , ctrl .NewHTTPRouterHandle ("Create" , h ))
92
94
service .Info ("mount" , "ctrl" , "Bottle" , "action" , "Create" , "route" , "POST /cellar/accounts/:accountID/bottles" )
93
95
h = func (c * goa.Context ) error {
94
96
ctx , err := NewDeleteBottleContext (c )
@@ -97,7 +99,7 @@ func MountBottleController(service goa.Service, ctrl BottleController) {
97
99
}
98
100
return ctrl .Delete (ctx )
99
101
}
100
- router .Handle ("DELETE" , "/cellar/accounts/:accountID/bottles/:bottleID" , goa .NewHTTPRouterHandle (service , "Bottle" , "Delete" , h ))
102
+ router .Handle ("DELETE" , "/cellar/accounts/:accountID/bottles/:bottleID" , ctrl .NewHTTPRouterHandle ("Delete" , h ))
101
103
service .Info ("mount" , "ctrl" , "Bottle" , "action" , "Delete" , "route" , "DELETE /cellar/accounts/:accountID/bottles/:bottleID" )
102
104
h = func (c * goa.Context ) error {
103
105
ctx , err := NewListBottleContext (c )
@@ -106,7 +108,7 @@ func MountBottleController(service goa.Service, ctrl BottleController) {
106
108
}
107
109
return ctrl .List (ctx )
108
110
}
109
- router .Handle ("GET" , "/cellar/accounts/:accountID/bottles" , goa .NewHTTPRouterHandle (service , "Bottle" , "List" , h ))
111
+ router .Handle ("GET" , "/cellar/accounts/:accountID/bottles" , ctrl .NewHTTPRouterHandle ("List" , h ))
110
112
service .Info ("mount" , "ctrl" , "Bottle" , "action" , "List" , "route" , "GET /cellar/accounts/:accountID/bottles" )
111
113
h = func (c * goa.Context ) error {
112
114
ctx , err := NewRateBottleContext (c )
@@ -115,7 +117,7 @@ func MountBottleController(service goa.Service, ctrl BottleController) {
115
117
}
116
118
return ctrl .Rate (ctx )
117
119
}
118
- router .Handle ("PUT" , "/cellar/accounts/:accountID/bottles/:bottleID/actions/rate" , goa .NewHTTPRouterHandle (service , "Bottle" , "Rate" , h ))
120
+ router .Handle ("PUT" , "/cellar/accounts/:accountID/bottles/:bottleID/actions/rate" , ctrl .NewHTTPRouterHandle ("Rate" , h ))
119
121
service .Info ("mount" , "ctrl" , "Bottle" , "action" , "Rate" , "route" , "PUT /cellar/accounts/:accountID/bottles/:bottleID/actions/rate" )
120
122
h = func (c * goa.Context ) error {
121
123
ctx , err := NewShowBottleContext (c )
@@ -124,7 +126,7 @@ func MountBottleController(service goa.Service, ctrl BottleController) {
124
126
}
125
127
return ctrl .Show (ctx )
126
128
}
127
- router .Handle ("GET" , "/cellar/accounts/:accountID/bottles/:bottleID" , goa .NewHTTPRouterHandle (service , "Bottle" , "Show" , h ))
129
+ router .Handle ("GET" , "/cellar/accounts/:accountID/bottles/:bottleID" , ctrl .NewHTTPRouterHandle ("Show" , h ))
128
130
service .Info ("mount" , "ctrl" , "Bottle" , "action" , "Show" , "route" , "GET /cellar/accounts/:accountID/bottles/:bottleID" )
129
131
h = func (c * goa.Context ) error {
130
132
ctx , err := NewUpdateBottleContext (c )
@@ -133,6 +135,6 @@ func MountBottleController(service goa.Service, ctrl BottleController) {
133
135
}
134
136
return ctrl .Update (ctx )
135
137
}
136
- router .Handle ("PATCH" , "/cellar/accounts/:accountID/bottles/:bottleID" , goa .NewHTTPRouterHandle (service , "Bottle" , "Update" , h ))
138
+ router .Handle ("PATCH" , "/cellar/accounts/:accountID/bottles/:bottleID" , ctrl .NewHTTPRouterHandle ("Update" , h ))
137
139
service .Info ("mount" , "ctrl" , "Bottle" , "action" , "Update" , "route" , "PATCH /cellar/accounts/:accountID/bottles/:bottleID" )
138
140
}
0 commit comments