Update documentation for DMaaP Mediator Producer
[nonrtric.git] / dmaap-mediator-producer / docs / docs.go
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 (
6         "bytes"
7         "encoding/json"
8         "strings"
9         "text/template"
10
11         "github.com/swaggo/swag"
12 )
13
14 var doc = `{
15     "schemes": {{ marshal .Schemes }},
16     "swagger": "2.0",
17     "info": {
18         "description": "{{escape .Description}}",
19         "title": "{{.Title}}",
20         "contact": {},
21         "license": {
22             "name": "Apache 2.0",
23             "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
24         },
25         "version": "{{.Version}}"
26     },
27     "host": "{{.Host}}",
28     "basePath": "{{.BasePath}}",
29     "paths": {
30         "/admin/log": {
31             "put": {
32                 "description": "Set the log level of the producer.",
33                 "tags": [
34                     "Admin"
35                 ],
36                 "summary": "Set log level",
37                 "parameters": [
38                     {
39                         "enum": [
40                             "Error",
41                             "Warn",
42                             "Info",
43                             "Debug"
44                         ],
45                         "type": "string",
46                         "description": "string enums",
47                         "name": "level",
48                         "in": "query"
49                     }
50                 ],
51                 "responses": {
52                     "200": {
53                         "description": ""
54                     },
55                     "400": {
56                         "description": "Bad Request",
57                         "schema": {
58                             "type": "string"
59                         }
60                     }
61                 }
62             }
63         },
64         "/health_check": {
65             "get": {
66                 "description": "Get the status of the producer. Will show if the producer has registered in ICS.",
67                 "tags": [
68                     "Data producer (callbacks)"
69                 ],
70                 "summary": "Get status",
71                 "responses": {
72                     "200": {
73                         "description": ""
74                     }
75                 }
76             }
77         },
78         "/info_job": {
79             "post": {
80                 "description": "Callback for ICS to add an info job",
81                 "consumes": [
82                     "application/json"
83                 ],
84                 "tags": [
85                     "Data producer (callbacks)"
86                 ],
87                 "summary": "Add info job",
88                 "parameters": [
89                     {
90                         "description": "Info job data",
91                         "name": "user",
92                         "in": "body",
93                         "required": true,
94                         "schema": {
95                             "$ref": "#/definitions/jobs.JobInfo"
96                         }
97                     }
98                 ],
99                 "responses": {
100                     "200": {
101                         "description": ""
102                     },
103                     "400": {
104                         "description": "Bad Request",
105                         "schema": {
106                             "type": "string"
107                         }
108                     }
109                 }
110             }
111         },
112         "/info_job/{infoJobId}": {
113             "delete": {
114                 "description": "Callback for ICS to delete an info job",
115                 "tags": [
116                     "Data producer (callbacks)"
117                 ],
118                 "summary": "Delete info job",
119                 "parameters": [
120                     {
121                         "type": "string",
122                         "description": "Info job ID",
123                         "name": "infoJobId",
124                         "in": "path",
125                         "required": true
126                     }
127                 ],
128                 "responses": {
129                     "200": {
130                         "description": ""
131                     }
132                 }
133             }
134         },
135         "/swagger": {
136             "get": {
137                 "description": "Get the Swagger API documentation for the producer.",
138                 "tags": [
139                     "Admin"
140                 ],
141                 "summary": "Get Swagger Documentation",
142                 "responses": {
143                     "200": {
144                         "description": ""
145                     }
146                 }
147             }
148         }
149     },
150     "definitions": {
151         "jobs.BufferTimeout": {
152             "type": "object",
153             "properties": {
154                 "maxSize": {
155                     "type": "integer"
156                 },
157                 "maxTimeMiliseconds": {
158                     "type": "integer"
159                 }
160             }
161         },
162         "jobs.JobInfo": {
163             "type": "object",
164             "properties": {
165                 "info_job_data": {
166                     "$ref": "#/definitions/jobs.Parameters"
167                 },
168                 "info_job_identity": {
169                     "type": "string"
170                 },
171                 "info_type_identity": {
172                     "type": "string"
173                 },
174                 "last_updated": {
175                     "type": "string"
176                 },
177                 "owner": {
178                     "type": "string"
179                 },
180                 "target_uri": {
181                     "type": "string"
182                 }
183             }
184         },
185         "jobs.Parameters": {
186             "type": "object",
187             "properties": {
188                 "bufferTimeout": {
189                     "$ref": "#/definitions/jobs.BufferTimeout"
190                 }
191             }
192         }
193     }
194 }`
195
196 type swaggerInfo struct {
197         Version     string
198         Host        string
199         BasePath    string
200         Schemes     []string
201         Title       string
202         Description string
203 }
204
205 // SwaggerInfo holds exported Swagger Info so clients can modify it
206 var SwaggerInfo = swaggerInfo{
207         Version:     "1.1.0",
208         Host:        "",
209         BasePath:    "",
210         Schemes:     []string{},
211         Title:       "DMaaP Mediator Producer",
212         Description: "",
213 }
214
215 type s struct{}
216
217 func (s *s) ReadDoc() string {
218         sInfo := SwaggerInfo
219         sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
220
221         t, err := template.New("swagger_info").Funcs(template.FuncMap{
222                 "marshal": func(v interface{}) string {
223                         a, _ := json.Marshal(v)
224                         return string(a)
225                 },
226                 "escape": func(v interface{}) string {
227                         // escape tabs
228                         str := strings.Replace(v.(string), "\t", "\\t", -1)
229                         // replace " with \", and if that results in \\", replace that with \\\"
230                         str = strings.Replace(str, "\"", "\\\"", -1)
231                         return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
232                 },
233         }).Parse(doc)
234         if err != nil {
235                 return doc
236         }
237
238         var tpl bytes.Buffer
239         if err := t.Execute(&tpl, sInfo); err != nil {
240                 return doc
241         }
242
243         return tpl.String()
244 }
245
246 func init() {
247         swag.Register("swagger", &s{})
248 }