@@ -15,66 +15,76 @@ import (
1515 courierhttp "github.com/octohelm/courier/pkg/courierhttp"
1616)
1717
18- type GetStoreBlob struct {
19- courierhttp.MethodGet `path:"/api/example/v0/store/{scope}/blobs/{digest} "`
18+ type Cookie struct {
19+ courierhttp.MethodPost `path:"/api/example/v0/cookie-ping-pong "`
2020
21- GetStoreBlobParameters
21+ CookieParameters
2222}
2323
24- type GetStoreBlobParameters struct {
25- Scope string `name:"scope" in:"path"`
26-
27- Digest string `name:"digest" in:"path"`
24+ type CookieParameters struct {
25+ Token string `name:"token,omitzero" in:"cookie"`
2826}
2927
30- func (GetStoreBlob ) ResponseData () * GetStoreBlobResponse {
31- return new (GetStoreBlobResponse )
28+ func (Cookie ) ResponseData () * courier. NoContent {
29+ return new (courier. NoContent )
3230}
3331
34- type UploadStoreBlob struct {
35- courierhttp.MethodPost `path:"/api/example/v0/store/{scope}/blobs/uploads "`
32+ type CreateOrg struct {
33+ courierhttp.MethodPost `path:"/api/example/v0/orgs "`
3634
37- UploadStoreBlobParameters
35+ CreateOrgParameters
3836}
3937
40- type UploadStoreBlobParameters struct {
41- Scope string `name:"scope" in:"path"`
42-
43- RequestBody IoReadCloser `in:"body" mime:"application/octet-stream"`
38+ type CreateOrgParameters struct {
39+ RequestBody OrgInfo `in:"body" mime:"application/json"`
4440}
4541
46- func (UploadStoreBlob ) ResponseData () * courier.NoContent {
42+ func (CreateOrg ) ResponseData () * courier.NoContent {
4743 return new (courier.NoContent )
4844}
4945
50- type GetFile struct {
51- courierhttp.MethodPost `path:"/api/example/v0/blobs/{path} "`
46+ type ListOrg struct {
47+ courierhttp.MethodGet `path:"/api/example/v0/orgs "`
5248
53- GetFileParameters
49+ ListOrgParameters
5450}
5551
56- type GetFileParameters struct {
57- Path string `name:"path " in:"path "`
52+ type ListOrgParameters struct {
53+ OrgID * OrgIDAsFilter `name:"org~id,omitzero " in:"query "`
5854}
5955
60- func (GetFile ) ResponseData () * GetFileResponse {
61- return new (GetFileResponse )
56+ func (ListOrg ) ResponseData () * ListOrgResponse {
57+ return new (ListOrgResponse )
6258}
6359
64- type UploadBlob struct {
65- courierhttp.MethodPost `path:"/api/example/v0/blobs "`
60+ type DeleteOrg struct {
61+ courierhttp.MethodDelete `path:"/api/example/v0/orgs/{orgName} "`
6662
67- UploadBlobParameters
63+ DeleteOrgParameters
6864}
6965
70- type UploadBlobParameters struct {
71- RequestBody IoReadCloser `in:"body" mime:"application/octet-stream "`
66+ type DeleteOrgParameters struct {
67+ OrgName string `name:"orgName" in:"path "`
7268}
7369
74- func (UploadBlob ) ResponseData () * courier.NoContent {
70+ func (DeleteOrg ) ResponseData () * courier.NoContent {
7571 return new (courier.NoContent )
7672}
7773
74+ type GetOrg struct {
75+ courierhttp.MethodGet `path:"/api/example/v0/orgs/{orgName}"`
76+
77+ GetOrgParameters
78+ }
79+
80+ type GetOrgParameters struct {
81+ OrgName OrgName `name:"orgName" in:"path"`
82+ }
83+
84+ func (GetOrg ) ResponseData () * GetOrgResponse {
85+ return new (GetOrgResponse )
86+ }
87+
7888type ListOrgOld struct {
7989 courierhttp.MethodGet `path:"/api/example/v0/org"`
8090
@@ -87,93 +97,81 @@ func (ListOrgOld) ResponseData() *courier.NoContent {
8797 return new (courier.NoContent )
8898}
8999
90- type Cookie struct {
91- courierhttp.MethodPost `path:"/api/example/v0/cookie-ping-pong "`
100+ type GetStoreBlob struct {
101+ courierhttp.MethodGet `path:"/api/example/v0/store/{scope}/blobs/{digest} "`
92102
93- CookieParameters
103+ GetStoreBlobParameters
94104}
95105
96- type CookieParameters struct {
97- Token string `name:"token,omitzero" in:"cookie"`
106+ type GetStoreBlobParameters struct {
107+ Scope string `name:"scope" in:"path"`
108+
109+ Digest string `name:"digest" in:"path"`
98110}
99111
100- func (Cookie ) ResponseData () * CookieResponse {
101- return new (CookieResponse )
112+ func (GetStoreBlob ) ResponseData () * GetStoreBlobResponse {
113+ return new (GetStoreBlobResponse )
102114}
103115
104- type CreateOrg struct {
105- courierhttp.MethodPost `path:"/api/example/v0/orgs "`
116+ type UploadStoreBlob struct {
117+ courierhttp.MethodPost `path:"/api/example/v0/store/{scope}/blobs/uploads "`
106118
107- CreateOrgParameters
119+ UploadStoreBlobParameters
108120}
109121
110- type CreateOrgParameters struct {
111- RequestBody OrgInfo `in:"body" mime:"application/json"`
122+ type UploadStoreBlobParameters struct {
123+ Scope string `name:"scope" in:"path"`
124+
125+ RequestBody IoReadCloser `in:"body" mime:"application/octet-stream"`
112126}
113127
114- func (CreateOrg ) ResponseData () * courier.NoContent {
128+ func (UploadStoreBlob ) ResponseData () * courier.NoContent {
115129 return new (courier.NoContent )
116130}
117131
118- type ListOrg struct {
119- courierhttp.MethodGet `path:"/api/example/v0/orgs "`
132+ type GetFile struct {
133+ courierhttp.MethodPost `path:"/api/example/v0/blobs/{path} "`
120134
121- ListOrgParameters
135+ GetFileParameters
122136}
123137
124- type ListOrgParameters struct {
125- OrgID * OrgIDAsFilter `name:"org~id,omitzero " in:"query "`
138+ type GetFileParameters struct {
139+ Path string `name:"path " in:"path "`
126140}
127141
128- func (ListOrg ) ResponseData () * ListOrgResponse {
129- return new (ListOrgResponse )
142+ func (GetFile ) ResponseData () * GetFileResponse {
143+ return new (GetFileResponse )
130144}
131145
132- type DeleteOrg struct {
133- courierhttp.MethodDelete `path:"/api/example/v0/orgs/{orgName} "`
146+ type UploadBlob struct {
147+ courierhttp.MethodPost `path:"/api/example/v0/blobs "`
134148
135- DeleteOrgParameters
149+ UploadBlobParameters
136150}
137151
138- type DeleteOrgParameters struct {
139- OrgName string `name:"orgName" in:"path "`
152+ type UploadBlobParameters struct {
153+ RequestBody IoReadCloser `in:"body" mime:"application/octet-stream "`
140154}
141155
142- func (DeleteOrg ) ResponseData () * courier.NoContent {
156+ func (UploadBlob ) ResponseData () * courier.NoContent {
143157 return new (courier.NoContent )
144158}
145159
146- type GetOrg struct {
147- courierhttp.MethodGet `path:"/api/example/v0/orgs/{orgName}"`
148-
149- GetOrgParameters
150- }
151-
152- type GetOrgParameters struct {
153- OrgName OrgName `name:"orgName" in:"path"`
154- }
155-
156- func (GetOrg ) ResponseData () * GetOrgResponse {
157- return new (GetOrgResponse )
158- }
160+ type GetFileResponse = string
159161
160162type (
161- OrgDetail = org.Detail
162- OrgName = org.Name
163- Time = time.Time
164- OrgType = domainorg.Type
165- IoReadCloser = io.ReadCloser
166- OrgInfo = org.Info
167- OrgIDAsFilter = filter.Filter [org.ID ]
168- GetOrgResponse = org.Detail
169- GetFileResponse = string
163+ GetOrgResponse = org.Detail
164+ GetStoreBlobResponse = string
170165)
171166
172- type GetStoreBlobResponse = string
173-
174- type CookieResponse = any
175-
176167type (
168+ IoReadCloser = io.ReadCloser
177169 ListOrgResponse = org.DataList [org.Info ]
170+ OrgDetail = org.Detail
171+ OrgIDAsFilter = filter.Filter [org.ID ]
172+ OrgInfo = org.Info
178173 OrgInfoAsDataList = org.DataList [org.Info ]
174+ OrgName = org.Name
175+ OrgType = domainorg.Type
176+ Time = time.Time
179177)
0 commit comments