docs.go
1 // Package docs Code generated by swaggo/swag. DO NOT EDIT 2 package docs 3 4 import "github.com/swaggo/swag" 5 6 const docTemplate = `{ 7 "schemes": {{ marshal .Schemes }}, 8 "consumes": [ 9 "application/json" 10 ], 11 "produces": [ 12 "application/json" 13 ], 14 "swagger": "2.0", 15 "info": { 16 "description": "{{escape .Description}}", 17 "title": "{{.Title}}", 18 "contact": { 19 "name": "Marius", 20 "url": "https://xn--gckvb8fzb.com", 21 "email": "marius@xn--gckvb8fzb.com" 22 }, 23 "license": { 24 "name": "GPL-3.0", 25 "url": "https://github.com/mrusme/journalist/blob/master/LICENSE" 26 }, 27 "version": "{{.Version}}" 28 }, 29 "host": "{{.Host}}", 30 "basePath": "{{.BasePath}}", 31 "paths": { 32 "/feeds": { 33 "get": { 34 "security": [ 35 { 36 "BasicAuth": [] 37 } 38 ], 39 "description": "Get all feeds", 40 "consumes": [ 41 "application/json" 42 ], 43 "produces": [ 44 "application/json" 45 ], 46 "tags": [ 47 "feeds" 48 ], 49 "summary": "List feeds", 50 "responses": { 51 "200": { 52 "description": "OK", 53 "schema": { 54 "$ref": "#/definitions/feeds.FeedListResponse" 55 } 56 }, 57 "400": { 58 "description": "Bad Request", 59 "schema": { 60 "$ref": "#/definitions/feeds.FeedListResponse" 61 } 62 }, 63 "404": { 64 "description": "Not Found", 65 "schema": { 66 "$ref": "#/definitions/feeds.FeedListResponse" 67 } 68 }, 69 "500": { 70 "description": "Internal Server Error", 71 "schema": { 72 "$ref": "#/definitions/feeds.FeedListResponse" 73 } 74 } 75 } 76 }, 77 "post": { 78 "security": [ 79 { 80 "BasicAuth": [] 81 } 82 ], 83 "description": "Add a new feed", 84 "consumes": [ 85 "application/json" 86 ], 87 "produces": [ 88 "application/json" 89 ], 90 "tags": [ 91 "feeds" 92 ], 93 "summary": "Create a feed", 94 "parameters": [ 95 { 96 "description": "Add feed", 97 "name": "feed", 98 "in": "body", 99 "required": true, 100 "schema": { 101 "$ref": "#/definitions/feeds.FeedCreateModel" 102 } 103 } 104 ], 105 "responses": { 106 "200": { 107 "description": "OK", 108 "schema": { 109 "$ref": "#/definitions/feeds.FeedCreateResponse" 110 } 111 }, 112 "400": { 113 "description": "Bad Request", 114 "schema": { 115 "$ref": "#/definitions/feeds.FeedCreateResponse" 116 } 117 }, 118 "404": { 119 "description": "Not Found", 120 "schema": { 121 "$ref": "#/definitions/feeds.FeedCreateResponse" 122 } 123 }, 124 "500": { 125 "description": "Internal Server Error", 126 "schema": { 127 "$ref": "#/definitions/feeds.FeedCreateResponse" 128 } 129 } 130 } 131 } 132 }, 133 "/feeds/{id}": { 134 "get": { 135 "security": [ 136 { 137 "BasicAuth": [] 138 } 139 ], 140 "description": "Get feed by ID", 141 "consumes": [ 142 "application/json" 143 ], 144 "produces": [ 145 "application/json" 146 ], 147 "tags": [ 148 "feeds" 149 ], 150 "summary": "Show a feed", 151 "parameters": [ 152 { 153 "type": "string", 154 "description": "Feed ID", 155 "name": "id", 156 "in": "path", 157 "required": true 158 } 159 ], 160 "responses": { 161 "200": { 162 "description": "OK", 163 "schema": { 164 "$ref": "#/definitions/feeds.FeedShowResponse" 165 } 166 }, 167 "400": { 168 "description": "Bad Request", 169 "schema": { 170 "$ref": "#/definitions/feeds.FeedShowResponse" 171 } 172 }, 173 "404": { 174 "description": "Not Found", 175 "schema": { 176 "$ref": "#/definitions/feeds.FeedShowResponse" 177 } 178 }, 179 "500": { 180 "description": "Internal Server Error", 181 "schema": { 182 "$ref": "#/definitions/feeds.FeedShowResponse" 183 } 184 } 185 } 186 } 187 }, 188 "/tokens": { 189 "post": { 190 "security": [ 191 { 192 "BasicAuth": [] 193 } 194 ], 195 "description": "Add a new token", 196 "consumes": [ 197 "application/json" 198 ], 199 "produces": [ 200 "application/json" 201 ], 202 "tags": [ 203 "tokens" 204 ], 205 "summary": "Create a token", 206 "parameters": [ 207 { 208 "description": "Add token", 209 "name": "token", 210 "in": "body", 211 "required": true, 212 "schema": { 213 "$ref": "#/definitions/tokens.TokenCreateModel" 214 } 215 } 216 ], 217 "responses": { 218 "200": { 219 "description": "OK", 220 "schema": { 221 "$ref": "#/definitions/tokens.TokenCreateResponse" 222 } 223 }, 224 "400": { 225 "description": "Bad Request", 226 "schema": { 227 "$ref": "#/definitions/tokens.TokenCreateResponse" 228 } 229 }, 230 "404": { 231 "description": "Not Found", 232 "schema": { 233 "$ref": "#/definitions/tokens.TokenCreateResponse" 234 } 235 }, 236 "500": { 237 "description": "Internal Server Error", 238 "schema": { 239 "$ref": "#/definitions/tokens.TokenCreateResponse" 240 } 241 } 242 } 243 } 244 }, 245 "/users": { 246 "get": { 247 "security": [ 248 { 249 "BasicAuth": [] 250 } 251 ], 252 "description": "Get all users", 253 "consumes": [ 254 "application/json" 255 ], 256 "produces": [ 257 "application/json" 258 ], 259 "tags": [ 260 "users" 261 ], 262 "summary": "List users", 263 "responses": { 264 "200": { 265 "description": "OK", 266 "schema": { 267 "$ref": "#/definitions/users.UserListResponse" 268 } 269 }, 270 "400": { 271 "description": "Bad Request", 272 "schema": { 273 "$ref": "#/definitions/users.UserListResponse" 274 } 275 }, 276 "404": { 277 "description": "Not Found", 278 "schema": { 279 "$ref": "#/definitions/users.UserListResponse" 280 } 281 }, 282 "500": { 283 "description": "Internal Server Error", 284 "schema": { 285 "$ref": "#/definitions/users.UserListResponse" 286 } 287 } 288 } 289 }, 290 "post": { 291 "security": [ 292 { 293 "BasicAuth": [] 294 } 295 ], 296 "description": "Add a new user", 297 "consumes": [ 298 "application/json" 299 ], 300 "produces": [ 301 "application/json" 302 ], 303 "tags": [ 304 "users" 305 ], 306 "summary": "Create a user", 307 "parameters": [ 308 { 309 "description": "Add user", 310 "name": "user", 311 "in": "body", 312 "required": true, 313 "schema": { 314 "$ref": "#/definitions/users.UserCreateModel" 315 } 316 } 317 ], 318 "responses": { 319 "200": { 320 "description": "OK", 321 "schema": { 322 "$ref": "#/definitions/users.UserCreateResponse" 323 } 324 }, 325 "400": { 326 "description": "Bad Request", 327 "schema": { 328 "$ref": "#/definitions/users.UserCreateResponse" 329 } 330 }, 331 "404": { 332 "description": "Not Found", 333 "schema": { 334 "$ref": "#/definitions/users.UserCreateResponse" 335 } 336 }, 337 "500": { 338 "description": "Internal Server Error", 339 "schema": { 340 "$ref": "#/definitions/users.UserCreateResponse" 341 } 342 } 343 } 344 } 345 }, 346 "/users/{id}": { 347 "get": { 348 "security": [ 349 { 350 "BasicAuth": [] 351 } 352 ], 353 "description": "Get user by ID", 354 "consumes": [ 355 "application/json" 356 ], 357 "produces": [ 358 "application/json" 359 ], 360 "tags": [ 361 "users" 362 ], 363 "summary": "Show a user", 364 "parameters": [ 365 { 366 "type": "string", 367 "description": "User ID", 368 "name": "id", 369 "in": "path", 370 "required": true 371 } 372 ], 373 "responses": { 374 "200": { 375 "description": "OK", 376 "schema": { 377 "$ref": "#/definitions/users.UserShowResponse" 378 } 379 }, 380 "400": { 381 "description": "Bad Request", 382 "schema": { 383 "$ref": "#/definitions/users.UserShowResponse" 384 } 385 }, 386 "404": { 387 "description": "Not Found", 388 "schema": { 389 "$ref": "#/definitions/users.UserShowResponse" 390 } 391 }, 392 "500": { 393 "description": "Internal Server Error", 394 "schema": { 395 "$ref": "#/definitions/users.UserShowResponse" 396 } 397 } 398 } 399 }, 400 "put": { 401 "security": [ 402 { 403 "BasicAuth": [] 404 } 405 ], 406 "description": "Change an existing user", 407 "consumes": [ 408 "application/json" 409 ], 410 "produces": [ 411 "application/json" 412 ], 413 "tags": [ 414 "users" 415 ], 416 "summary": "Update a user", 417 "parameters": [ 418 { 419 "type": "string", 420 "description": "User ID", 421 "name": "id", 422 "in": "path", 423 "required": true 424 }, 425 { 426 "description": "Change user", 427 "name": "user", 428 "in": "body", 429 "required": true, 430 "schema": { 431 "$ref": "#/definitions/users.UserUpdateModel" 432 } 433 } 434 ], 435 "responses": { 436 "200": { 437 "description": "OK", 438 "schema": { 439 "$ref": "#/definitions/users.UserUpdateResponse" 440 } 441 }, 442 "400": { 443 "description": "Bad Request", 444 "schema": { 445 "$ref": "#/definitions/users.UserUpdateResponse" 446 } 447 }, 448 "404": { 449 "description": "Not Found", 450 "schema": { 451 "$ref": "#/definitions/users.UserUpdateResponse" 452 } 453 }, 454 "500": { 455 "description": "Internal Server Error", 456 "schema": { 457 "$ref": "#/definitions/users.UserUpdateResponse" 458 } 459 } 460 } 461 } 462 } 463 }, 464 "definitions": { 465 "feeds.FeedCreateModel": { 466 "type": "object", 467 "required": [ 468 "url" 469 ], 470 "properties": { 471 "group": { 472 "type": "string", 473 "maxLength": 32 474 }, 475 "name": { 476 "type": "string", 477 "maxLength": 32 478 }, 479 "password": { 480 "type": "string" 481 }, 482 "url": { 483 "type": "string" 484 }, 485 "username": { 486 "type": "string" 487 } 488 } 489 }, 490 "feeds.FeedCreateResponse": { 491 "type": "object", 492 "properties": { 493 "feed": { 494 "$ref": "#/definitions/feeds.FeedShowModel" 495 }, 496 "message": { 497 "type": "string" 498 }, 499 "success": { 500 "type": "boolean" 501 } 502 } 503 }, 504 "feeds.FeedListResponse": { 505 "type": "object", 506 "properties": { 507 "feeds": { 508 "type": "array", 509 "items": { 510 "$ref": "#/definitions/feeds.FeedShowModel" 511 } 512 }, 513 "message": { 514 "type": "string" 515 }, 516 "success": { 517 "type": "boolean" 518 } 519 } 520 }, 521 "feeds.FeedShowModel": { 522 "type": "object", 523 "properties": { 524 "group": { 525 "type": "string", 526 "maxLength": 32 527 }, 528 "id": { 529 "type": "string" 530 }, 531 "name": { 532 "type": "string", 533 "maxLength": 32 534 }, 535 "url": { 536 "type": "string" 537 } 538 } 539 }, 540 "feeds.FeedShowResponse": { 541 "type": "object", 542 "properties": { 543 "feed": { 544 "$ref": "#/definitions/feeds.FeedShowModel" 545 }, 546 "message": { 547 "type": "string" 548 }, 549 "success": { 550 "type": "boolean" 551 } 552 } 553 }, 554 "tokens.TokenCreateModel": { 555 "type": "object", 556 "required": [ 557 "name" 558 ], 559 "properties": { 560 "name": { 561 "type": "string", 562 "maxLength": 32 563 } 564 } 565 }, 566 "tokens.TokenCreateResponse": { 567 "type": "object", 568 "properties": { 569 "message": { 570 "type": "string" 571 }, 572 "success": { 573 "type": "boolean" 574 }, 575 "token": { 576 "$ref": "#/definitions/tokens.TokenShowModel" 577 } 578 } 579 }, 580 "tokens.TokenShowModel": { 581 "type": "object", 582 "properties": { 583 "id": { 584 "type": "string" 585 }, 586 "token": { 587 "type": "string" 588 }, 589 "tokenname": { 590 "type": "string" 591 }, 592 "type": { 593 "type": "string" 594 } 595 } 596 }, 597 "users.UserCreateModel": { 598 "type": "object", 599 "required": [ 600 "password", 601 "role", 602 "username" 603 ], 604 "properties": { 605 "password": { 606 "type": "string" 607 }, 608 "role": { 609 "type": "string" 610 }, 611 "username": { 612 "type": "string", 613 "maxLength": 32 614 } 615 } 616 }, 617 "users.UserCreateResponse": { 618 "type": "object", 619 "properties": { 620 "message": { 621 "type": "string" 622 }, 623 "success": { 624 "type": "boolean" 625 }, 626 "user": { 627 "$ref": "#/definitions/users.UserShowModel" 628 } 629 } 630 }, 631 "users.UserListResponse": { 632 "type": "object", 633 "properties": { 634 "message": { 635 "type": "string" 636 }, 637 "success": { 638 "type": "boolean" 639 }, 640 "users": { 641 "type": "array", 642 "items": { 643 "$ref": "#/definitions/users.UserShowModel" 644 } 645 } 646 } 647 }, 648 "users.UserShowModel": { 649 "type": "object", 650 "properties": { 651 "id": { 652 "type": "string" 653 }, 654 "role": { 655 "type": "string" 656 }, 657 "username": { 658 "type": "string" 659 } 660 } 661 }, 662 "users.UserShowResponse": { 663 "type": "object", 664 "properties": { 665 "message": { 666 "type": "string" 667 }, 668 "success": { 669 "type": "boolean" 670 }, 671 "user": { 672 "$ref": "#/definitions/users.UserShowModel" 673 } 674 } 675 }, 676 "users.UserUpdateModel": { 677 "type": "object", 678 "properties": { 679 "password": { 680 "type": "string", 681 "minLength": 5 682 }, 683 "role": { 684 "type": "string" 685 } 686 } 687 }, 688 "users.UserUpdateResponse": { 689 "type": "object", 690 "properties": { 691 "message": { 692 "type": "string" 693 }, 694 "success": { 695 "type": "boolean" 696 }, 697 "user": { 698 "$ref": "#/definitions/users.UserShowModel" 699 } 700 } 701 } 702 }, 703 "securityDefinitions": { 704 "BasicAuth": { 705 "type": "basic" 706 } 707 } 708 }` 709 710 // SwaggerInfo holds exported Swagger Info so clients can modify it 711 var SwaggerInfo = &swag.Spec{ 712 Version: "1.0", 713 Host: "localhost:8000", 714 BasePath: "/api/v1", 715 Schemes: []string{"http"}, 716 Title: "Journalist API", 717 Description: "The Journalist REST API v1", 718 InfoInstanceName: "swagger", 719 SwaggerTemplate: docTemplate, 720 LeftDelim: "{{", 721 RightDelim: "}}", 722 } 723 724 func init() { 725 swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) 726 }