Passed
Push — master ( cf509e...9f6a35 )
by Rodolfo
58s
created

docs.*s.ReadDoc   A

Complexity

Conditions 4

Size

Total Lines 20
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 14
dl 0
loc 20
rs 9.7
c 0
b 0
f 0
nop 0
1
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
2
// This file was generated by swaggo/swag
3
package docs
4
5
import "github.com/swaggo/swag"
6
7
const docTemplate_swagger = `{
8
    "schemes": {{ marshal .Schemes }},
9
    "swagger": "2.0",
10
    "info": {
11
        "description": "{{escape .Description}}",
12
        "title": "{{.Title}}",
13
        "contact": {
14
            "name": "Go Programming Language Workshop",
15
            "url": "https://golang-workshop.io",
16
            "email": "[email protected]"
17
        },
18
        "license": {
19
            "name": "MIT License",
20
            "url": "https://opensource.org/licenses/mit-license.php"
21
        },
22
        "version": "{{.Version}}"
23
    },
24
    "host": "{{.Host}}",
25
    "basePath": "{{.BasePath}}",
26
    "paths": {
27
        "/": {
28
            "get": {
29
                "description": "Get all to-do items from the data store",
30
                "produces": [
31
                    "application/json"
32
                ],
33
                "summary": "Get all to-do items",
34
                "parameters": [
35
                    {
36
                        "type": "string",
37
                        "description": "Authorization Token",
38
                        "name": "X-Todo-API-Authorization-Token",
39
                        "in": "header",
40
                        "required": true
41
                    }
42
                ],
43
                "responses": {
44
                    "200": {
45
                        "description": "OK",
46
                        "schema": {
47
                            "type": "array",
48
                            "items": {
49
                                "$ref": "#/definitions/models.Item"
50
                            }
51
                        },
52
                        "headers": {
53
                            "X-Todo-API-Request-ID": {
54
                                "type": "string",
55
                                "description": "API Request Id"
56
                            },
57
                            "X-Todo-API-Revision": {
58
                                "type": "string",
59
                                "description": "API Revision Number"
60
                            }
61
                        }
62
                    }
63
                }
64
            },
65
            "put": {
66
                "description": "Insert a to-do item into the data store",
67
                "consumes": [
68
                    "application/json"
69
                ],
70
                "produces": [
71
                    "application/json"
72
                ],
73
                "summary": "Create a to-do item",
74
                "parameters": [
75
                    {
76
                        "description": "To-Do Item",
77
                        "name": "item",
78
                        "in": "body",
79
                        "required": true,
80
                        "schema": {
81
                            "$ref": "#/definitions/models.Item"
82
                        }
83
                    },
84
                    {
85
                        "type": "string",
86
                        "description": "Authorization Token",
87
                        "name": "X-Todo-API-Authorization-Token",
88
                        "in": "header",
89
                        "required": true
90
                    }
91
                ],
92
                "responses": {
93
                    "201": {
94
                        "description": "{\\\"message\\\": \\\"Ok\\\"}",
95
                        "schema": {
96
                            "type": "string"
97
                        },
98
                        "headers": {
99
                            "X-Todo-API-Request-ID": {
100
                                "type": "string",
101
                                "description": "API Request Id"
102
                            },
103
                            "X-Todo-API-Revision": {
104
                                "type": "string",
105
                                "description": "API Revision Number"
106
                            }
107
                        }
108
                    }
109
                }
110
            },
111
            "post": {
112
                "description": "Insert a to-do item into the data store",
113
                "consumes": [
114
                    "application/json"
115
                ],
116
                "produces": [
117
                    "application/json"
118
                ],
119
                "summary": "Create a to-do item",
120
                "parameters": [
121
                    {
122
                        "description": "To-Do Item",
123
                        "name": "item",
124
                        "in": "body",
125
                        "required": true,
126
                        "schema": {
127
                            "$ref": "#/definitions/models.Item"
128
                        }
129
                    },
130
                    {
131
                        "type": "string",
132
                        "description": "Authorization Token",
133
                        "name": "X-Todo-API-Authorization-Token",
134
                        "in": "header",
135
                        "required": true
136
                    }
137
                ],
138
                "responses": {
139
                    "201": {
140
                        "description": "{\\\"message\\\": \\\"Ok\\\"}",
141
                        "schema": {
142
                            "type": "string"
143
                        },
144
                        "headers": {
145
                            "X-Todo-API-Request-ID": {
146
                                "type": "string",
147
                                "description": "API Request Id"
148
                            },
149
                            "X-Todo-API-Revision": {
150
                                "type": "string",
151
                                "description": "API Revision Number"
152
                            }
153
                        }
154
                    }
155
                }
156
            }
157
        },
158
        "/{id}": {
159
            "get": {
160
                "description": "Get a to-do item by id from the data store",
161
                "produces": [
162
                    "application/json"
163
                ],
164
                "summary": "Get a to-do item",
165
                "parameters": [
166
                    {
167
                        "type": "integer",
168
                        "description": "To-Do Item Id",
169
                        "name": "id",
170
                        "in": "path",
171
                        "required": true
172
                    },
173
                    {
174
                        "type": "string",
175
                        "description": "Authorization Token",
176
                        "name": "X-Todo-API-Authorization-Token",
177
                        "in": "header",
178
                        "required": true
179
                    }
180
                ],
181
                "responses": {
182
                    "200": {
183
                        "description": "OK",
184
                        "schema": {
185
                            "$ref": "#/definitions/models.Item"
186
                        },
187
                        "headers": {
188
                            "X-Todo-API-Request-ID": {
189
                                "type": "string",
190
                                "description": "API Request Id"
191
                            },
192
                            "X-Todo-API-Revision": {
193
                                "type": "string",
194
                                "description": "API Revision Number"
195
                            }
196
                        }
197
                    }
198
                }
199
            },
200
            "delete": {
201
                "description": "Delete a to-do item from the data store",
202
                "produces": [
203
                    "application/json"
204
                ],
205
                "summary": "Delete a to-do item",
206
                "parameters": [
207
                    {
208
                        "type": "integer",
209
                        "description": "To-Do Item Id",
210
                        "name": "id",
211
                        "in": "path",
212
                        "required": true
213
                    },
214
                    {
215
                        "type": "string",
216
                        "description": "Authorization Token",
217
                        "name": "X-Todo-API-Authorization-Token",
218
                        "in": "header",
219
                        "required": true
220
                    }
221
                ],
222
                "responses": {
223
                    "200": {
224
                        "description": "{\\\"message\\\": \\\"Ok\\\"}",
225
                        "schema": {
226
                            "type": "string"
227
                        },
228
                        "headers": {
229
                            "X-Todo-API-Request-ID": {
230
                                "type": "string",
231
                                "description": "API Request Id"
232
                            },
233
                            "X-Todo-API-Revision": {
234
                                "type": "string",
235
                                "description": "API Revision Number"
236
                            }
237
                        }
238
                    }
239
                }
240
            },
241
            "patch": {
242
                "description": "Update a to-do item into the data store",
243
                "consumes": [
244
                    "application/json"
245
                ],
246
                "produces": [
247
                    "application/json"
248
                ],
249
                "summary": "Update a to-do item",
250
                "parameters": [
251
                    {
252
                        "type": "integer",
253
                        "description": "To-Do Item Id",
254
                        "name": "id",
255
                        "in": "path",
256
                        "required": true
257
                    },
258
                    {
259
                        "description": "To-Do Item",
260
                        "name": "item",
261
                        "in": "body",
262
                        "required": true,
263
                        "schema": {
264
                            "$ref": "#/definitions/models.Item"
265
                        }
266
                    },
267
                    {
268
                        "type": "string",
269
                        "description": "Authorization Token",
270
                        "name": "X-Todo-API-Authorization-Token",
271
                        "in": "header",
272
                        "required": true
273
                    }
274
                ],
275
                "responses": {
276
                    "200": {
277
                        "description": "{\\\"message\\\": \\\"Ok\\\"}",
278
                        "schema": {
279
                            "type": "string"
280
                        },
281
                        "headers": {
282
                            "X-Todo-API-Request-ID": {
283
                                "type": "string",
284
                                "description": "API Request Id"
285
                            },
286
                            "X-Todo-API-Revision": {
287
                                "type": "string",
288
                                "description": "API Revision Number"
289
                            }
290
                        }
291
                    }
292
                }
293
            }
294
        }
295
    },
296
    "definitions": {
297
        "models.Item": {
298
            "type": "object",
299
            "properties": {
300
                "id": {
301
                    "type": "integer"
302
                },
303
                "isdone": {
304
                    "type": "boolean"
305
                },
306
                "title": {
307
                    "type": "string"
308
                }
309
            }
310
        }
311
    }
312
}`
313
314
// SwaggerInfo_swagger holds exported Swagger Info so clients can modify it
315
var SwaggerInfo_swagger = &swag.Spec{
316
	Version:          "1.0",
317
	Host:             "todo.golang-workshop.io",
318
	BasePath:         "/api",
319
	Schemes:          []string{},
320
	Title:            "To-Do Sample API",
321
	Description:      "Sample To-Do API written in Golang for Go Programming Language Workshop.",
322
	InfoInstanceName: "swagger",
323
	SwaggerTemplate:  docTemplate_swagger,
324
}
325
326
func init() {
327
	swag.Register(SwaggerInfo_swagger.InstanceName(), SwaggerInfo_swagger)
328
}
329