// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag package docs import ( "bytes" "encoding/json" "strings" "github.com/alecthomas/template" "github.com/swaggo/swag" ) var doc = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{.Description}}", "title": "{{.Title}}", "contact": {}, "license": {}, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/v1/about": { "get": { "description": "Returns the supported API versions and the internal build nr", "produces": [ "application/json" ], "tags": [ "General" ], "summary": "Lists general information about the API", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/client.About" } } } } }, "/v1/attachments": { "get": { "description": "List all downloaded attachments", "produces": [ "application/json" ], "tags": [ "Attachments" ], "summary": "List all attachments.", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/attachments/{attachment}": { "get": { "description": "Serve the attachment with the given id", "produces": [ "application/json" ], "tags": [ "Attachments" ], "summary": "Serve Attachment.", "parameters": [ { "type": "string", "description": "Attachment ID", "name": "attachment", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } }, "delete": { "description": "Remove the attachment with the given id from filesystem.", "produces": [ "application/json" ], "tags": [ "Attachments" ], "summary": "Remove attachment.", "parameters": [ { "type": "string", "description": "Attachment ID", "name": "attachment", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/configuration": { "get": { "description": "List the REST API configuration.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "General" ], "summary": "List the REST API configuration.", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/api.Configuration" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } }, "post": { "description": "Set the REST API configuration.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "General" ], "summary": "Set the REST API configuration.", "parameters": [ { "description": "Configuration", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.Configuration" } } ], "responses": { "204": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/contacts{number}": { "put": { "description": "Updates the info associated to a number on the contact list.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Contacts" ], "summary": "Updates the info associated to a number on the contact list. If the contact doesn’t exist yet, it will be added.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "description": "Contact", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.UpdateContactRequest" } } ], "responses": { "204": {}, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/devices/{number}": { "post": { "description": "Links another device to this device. Only works, if this is the master device.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Devices" ], "summary": "Links another device to this device.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "description": "Request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.AddDeviceRequest" } } ], "responses": { "204": {}, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/groups/{number}": { "get": { "description": "List all Signal Groups.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "List all Signal Groups.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/client.GroupEntry" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } }, "post": { "description": "Create a new Signal Group with the specified members.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "Create a new Signal Group.", "parameters": [ { "description": "Input Data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.CreateGroupRequest" } }, { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.CreateGroupResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/groups/{number}/{groupid}": { "get": { "description": "List a specific Signal Group.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "List a Signal Group.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "groupid", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/client.GroupEntry" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } }, "delete": { "description": "Delete the specified Signal Group.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "Delete a Signal Group.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "type": "string", "description": "Group Id", "name": "groupid", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/groups/{number}/{groupid}/admins": { "post": { "description": "Add one or more admins to an existing Signal Group.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "Add one or more admins to an existing Signal Group.", "parameters": [ { "description": "Admins", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.ChangeGroupAdminsRequest" } }, { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } }, "delete": { "description": "Remove one or more admins from an existing Signal Group.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "Remove one or more admins from an existing Signal Group.", "parameters": [ { "description": "Admins", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.ChangeGroupAdminsRequest" } }, { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/groups/{number}/{groupid}/block": { "post": { "description": "Block the specified Signal Group.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "Block a Signal Group.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "groupid", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/groups/{number}/{groupid}/join": { "post": { "description": "Join the specified Signal Group.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "Join a Signal Group.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "groupid", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/groups/{number}/{groupid}/members": { "post": { "description": "Add one or more members to an existing Signal Group.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "Add one or more members to an existing Signal Group.", "parameters": [ { "description": "Members", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.ChangeGroupMembersRequest" } }, { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } }, "delete": { "description": "Remove one or more members from an existing Signal Group.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "Remove one or more members from an existing Signal Group.", "parameters": [ { "description": "Members", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.ChangeGroupMembersRequest" } }, { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/groups/{number}/{groupid}/quit": { "post": { "description": "Quit the specified Signal Group.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Groups" ], "summary": "Quit a Signal Group.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "groupid", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/health": { "get": { "description": "Internally used by the docker container to perform the health check.", "produces": [ "application/json" ], "tags": [ "General" ], "summary": "API Health Check", "responses": { "204": { "description": "No Content", "schema": { "type": "string" } } } } }, "/v1/identities/{number}": { "get": { "description": "List all identities for the given number.", "produces": [ "application/json" ], "tags": [ "Identities" ], "summary": "List Identities", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/client.IdentityEntry" } } } } } }, "/v1/identities/{number}/trust/{numberToTrust}": { "put": { "description": "Trust an identity. When 'trust_all_known_keys' is set to' true', all known keys of this user are trusted. **This is only recommended for testing.**", "produces": [ "application/json" ], "tags": [ "Identities" ], "summary": "Trust Identity", "parameters": [ { "description": "Input Data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.TrustIdentityRequest" } }, { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "type": "string", "description": "Number To Trust", "name": "numberToTrust", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } } } } }, "/v1/profiles/{number}": { "put": { "description": "Set your name and optional an avatar.", "produces": [ "application/json" ], "tags": [ "Profiles" ], "summary": "Update Profile.", "parameters": [ { "description": "Profile Data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.UpdateProfileRequest" } }, { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/qrcodelink": { "get": { "description": "Link device and generate QR code", "produces": [ "application/json" ], "tags": [ "Devices" ], "summary": "Link device and generate QR code.", "parameters": [ { "type": "string", "description": "Device Name", "name": "device_name", "in": "query", "required": true } ], "responses": { "200": { "description": "Image", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/reactions/{number}": { "post": { "description": "React to a message", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reactions" ], "summary": "Send a reaction.", "parameters": [ { "description": "Reaction", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.Reaction" } } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } }, "delete": { "description": "Remove a reaction", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reactions" ], "summary": "Remove a reaction.", "parameters": [ { "description": "Reaction", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.Reaction" } } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/receive/{number}": { "get": { "description": "Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Messages" ], "summary": "Receive Signal Messages.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "type": "string", "description": "Receive timeout in seconds (default: 1)", "name": "timeout", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/register/{number}": { "post": { "description": "Register a phone number with the signal network.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Devices" ], "summary": "Register a phone number.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "description": "Additional Settings", "name": "data", "in": "body", "schema": { "$ref": "#/definitions/api.RegisterNumberRequest" } } ], "responses": { "201": {}, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/register/{number}/verify/{token}": { "post": { "description": "Verify a registered phone number with the signal network.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Devices" ], "summary": "Verify a registered phone number.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "description": "Additional Settings", "name": "data", "in": "body", "schema": { "$ref": "#/definitions/api.VerifyNumberSettings" } }, { "type": "string", "description": "Verification Code", "name": "token", "in": "path", "required": true } ], "responses": { "201": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/search": { "get": { "description": "Check if one or more phone numbers are registered with the Signal Service.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Search" ], "summary": "Check if one or more phone numbers are registered with the Signal Service.", "parameters": [ { "type": "array", "items": { "type": "string" }, "collectionFormat": "multi", "description": "Numbers to check", "name": "numbers", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/api.SearchResponse" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/send": { "post": { "description": "Send a signal message", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Messages" ], "summary": "Send a signal message.", "deprecated": true, "parameters": [ { "description": "Input Data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.SendMessageV1" } } ], "responses": { "201": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/typing-indicator/{number}": { "put": { "description": "Show Typing Indicator.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Messages" ], "summary": "Show Typing Indicator.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "description": "Type", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.TypingIndicatorRequest" } } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } }, "delete": { "description": "Hide Typing Indicator.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Messages" ], "summary": "Hide Typing Indicator.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "description": "Type", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.TypingIndicatorRequest" } } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v1/unregister/{number}": { "post": { "description": "Disables push support for this device. **WARNING:** If *delete_account* is set to *true*, the account will be deleted from the Signal Server. This cannot be undone without loss.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Devices" ], "summary": "Unregister a phone number.", "parameters": [ { "type": "string", "description": "Registered Phone Number", "name": "number", "in": "path", "required": true }, { "description": "Additional Settings", "name": "data", "in": "body", "schema": { "$ref": "#/definitions/api.UnregisterNumberRequest" } } ], "responses": { "204": {}, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } }, "/v2/send": { "post": { "description": "Send a signal message", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Messages" ], "summary": "Send a signal message.", "parameters": [ { "description": "Input Data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/api.SendMessageV2" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/api.SendMessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/api.Error" } } } } } }, "definitions": { "api.AddDeviceRequest": { "type": "object", "properties": { "uri": { "type": "string" } } }, "api.ChangeGroupAdminsRequest": { "type": "object", "properties": { "admins": { "type": "array", "items": { "type": "string" } } } }, "api.ChangeGroupMembersRequest": { "type": "object", "properties": { "members": { "type": "array", "items": { "type": "string" } } } }, "api.Configuration": { "type": "object", "properties": { "logging": { "type": "object", "$ref": "#/definitions/api.LoggingConfiguration" } } }, "api.CreateGroupRequest": { "type": "object", "properties": { "description": { "type": "string" }, "group_link": { "type": "string", "enum": [ "disabled", "enabled", "enabled-with-approval" ] }, "members": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "permissions": { "type": "object", "$ref": "#/definitions/api.GroupPermissions" } } }, "api.CreateGroupResponse": { "type": "object", "properties": { "id": { "type": "string" } } }, "api.Error": { "type": "object", "properties": { "error": { "type": "string" } } }, "api.GroupPermissions": { "type": "object", "properties": { "add_members": { "type": "string", "enum": [ "only-admins", "every-member" ] }, "edit_group": { "type": "string", "enum": [ "only-admins", "every-member" ] } } }, "api.LoggingConfiguration": { "type": "object", "properties": { "Level": { "type": "string" } } }, "api.Reaction": { "type": "object", "properties": { "reaction": { "type": "string" }, "recipient": { "type": "string" }, "target_author": { "type": "string" }, "timestamp": { "type": "integer" } } }, "api.RegisterNumberRequest": { "type": "object", "properties": { "captcha": { "type": "string" }, "use_voice": { "type": "boolean" } } }, "api.SearchResponse": { "type": "object", "properties": { "number": { "type": "string" }, "registered": { "type": "boolean" } } }, "api.SendMessageResponse": { "type": "object", "properties": { "timestamp": { "type": "string" } } }, "api.SendMessageV1": { "type": "object", "properties": { "base64_attachment": { "type": "string" }, "is_group": { "type": "boolean" }, "message": { "type": "string" }, "number": { "type": "string" }, "recipients": { "type": "array", "items": { "type": "string" } } } }, "api.SendMessageV2": { "type": "object", "properties": { "base64_attachments": { "type": "array", "items": { "type": "string" } }, "message": { "type": "string" }, "number": { "type": "string" }, "recipients": { "type": "array", "items": { "type": "string" } } } }, "api.TrustIdentityRequest": { "type": "object", "properties": { "trust_all_known_keys": { "type": "boolean", "example": false }, "verified_safety_number": { "type": "string" } } }, "api.TypingIndicatorRequest": { "type": "object", "properties": { "recipient": { "type": "string" } } }, "api.UnregisterNumberRequest": { "type": "object", "properties": { "delete_account": { "type": "boolean", "example": false } } }, "api.UpdateContactRequest": { "type": "object", "properties": { "expiration_in_seconds": { "type": "integer" }, "name": { "type": "string" }, "recipient": { "type": "string" } } }, "api.UpdateProfileRequest": { "type": "object", "properties": { "base64_avatar": { "type": "string" }, "name": { "type": "string" } } }, "api.VerifyNumberSettings": { "type": "object", "properties": { "pin": { "type": "string" } } }, "client.About": { "type": "object", "properties": { "build": { "type": "integer" }, "mode": { "type": "string" }, "version": { "type": "string" }, "versions": { "type": "array", "items": { "type": "string" } } } }, "client.GroupEntry": { "type": "object", "properties": { "admins": { "type": "array", "items": { "type": "string" } }, "blocked": { "type": "boolean" }, "id": { "type": "string" }, "internal_id": { "type": "string" }, "invite_link": { "type": "string" }, "members": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "pending_invites": { "type": "array", "items": { "type": "string" } }, "pending_requests": { "type": "array", "items": { "type": "string" } } } }, "client.IdentityEntry": { "type": "object", "properties": { "added": { "type": "string" }, "fingerprint": { "type": "string" }, "number": { "type": "string" }, "safety_number": { "type": "string" }, "status": { "type": "string" } } } }, "tags": [ { "description": "Some general endpoints.", "name": "General" }, { "description": "Register and link Devices.", "name": "Devices" }, { "description": "Create, List and Delete Signal Groups.", "name": "Groups" }, { "description": "Send and Receive Signal Messages.", "name": "Messages" }, { "description": "List and Delete Attachments.", "name": "Attachments" }, { "description": "Update Profile.", "name": "Profiles" }, { "description": "List and Trust Identities.", "name": "Identities" }, { "description": "React to messages.", "name": "Reactions" }, { "description": "Search the Signal Service.", "name": "Search" } ] }` type swaggerInfo struct { Version string Host string BasePath string Schemes []string Title string Description string } // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = swaggerInfo{ Version: "1.0", Host: "", BasePath: "/", Schemes: []string{}, Title: "Signal Cli REST API", Description: "This is the Signal Cli REST API documentation.", } type s struct{} func (s *s) ReadDoc() string { sInfo := SwaggerInfo sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) t, err := template.New("swagger_info").Funcs(template.FuncMap{ "marshal": func(v interface{}) string { a, _ := json.Marshal(v) return string(a) }, }).Parse(doc) if err != nil { return doc } var tpl bytes.Buffer if err := t.Execute(&tpl, sInfo); err != nil { return doc } return tpl.String() } func init() { swag.Register(swag.Name, &s{}) }