justlog/web/build/swagger.json

1295 lines
32 KiB
JSON

{
"consumes": [
"application/json",
"application/xml"
],
"produces": [
"application/json",
"text/plain"
],
"schemes": [
"https"
],
"swagger": "2.0",
"info": {
"description": "https://github.com/gempir/justlog",
"title": "justlog API"
},
"basePath": "/",
"paths": {
"/admin/channels": {
"post": {
"security": [
{
"api_key": []
}
],
"description": "Will add the channels to log, only works with userIds",
"consumes": [
"application/json"
],
"produces": [
"application/json",
"text/plain"
],
"schemes": [
"https"
],
"tags": [
"admin"
],
"operationId": "addChannels",
"parameters": [
{
"name": "Body",
"in": "body",
"schema": {
"$ref": "#/definitions/channelConfigsJoinRequest"
}
}
],
"responses": {
"200": {
"description": ""
},
"400": {
"description": ""
},
"405": {
"description": ""
},
"500": {
"description": ""
}
}
},
"delete": {
"security": [
{
"api_key": []
}
],
"description": "Will remove the channels to log, only works with userIds",
"consumes": [
"application/json"
],
"produces": [
"application/json",
"text/plain"
],
"schemes": [
"https"
],
"tags": [
"admin"
],
"operationId": "deleteChannels",
"parameters": [
{
"name": "Body",
"in": "body",
"schema": {
"$ref": "#/definitions/channelsDeleteRequest"
}
}
],
"responses": {
"200": {
"description": ""
},
"400": {
"description": ""
},
"405": {
"description": ""
},
"500": {
"description": ""
}
}
}
},
"/channel/{channel}": {
"get": {
"description": "Get entire channel logs of current day",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelLogs",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "Channel",
"name": "channel",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channel/{channel}/user/{username}": {
"get": {
"description": "Get user logs in channel of current month",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelUserLogs",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "Channel",
"name": "channel",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Username",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channel/{channel}/user/{username}/random": {
"get": {
"description": "Get a random line from a user in a given channel",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelUserLogsRandom",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "Channel",
"name": "channel",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Username",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channel/{channel}/user/{username}/{year}/{month}": {
"get": {
"description": "Get user logs in channel of given year month",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelUserLogsYearMonth",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "Channel",
"name": "channel",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Username",
"name": "username",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Year",
"name": "year",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Month",
"name": "month",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channel/{channel}/userid/{userid}": {
"get": {
"description": "Get user logs in channel of current month",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelUserIdLogs",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "Channel",
"name": "channel",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "UserId",
"name": "userid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channel/{channel}/userid/{userid}/random": {
"get": {
"description": "Get a random line from a user in a given channel",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelUserIdLogsRandom",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "Channel",
"name": "channel",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "UserId",
"name": "userid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channel/{channel}/userid/{userid}/{year}/{month}": {
"get": {
"description": "Get user logs in channel of given year month",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelUserIdLogsYearMonth",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "Channel",
"name": "channel",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Userid",
"name": "userid",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Year",
"name": "year",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Month",
"name": "month",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channel/{channel}/{year}/{month}/{day}": {
"get": {
"description": "Get entire channel logs of given day",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelLogsYearMonthDay",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "Channel",
"name": "channel",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Year",
"name": "year",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Month",
"name": "month",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Day",
"name": "day",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channelid/{channelid}/user/{username}": {
"get": {
"description": "Get user logs in channel of current month",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelIdUserLogs",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "ChannelId",
"name": "channelid",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Username",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channelid/{channelid}/user/{username}/{year}/{month}": {
"get": {
"description": "Get user logs in channel of given year month",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelIdUserLogsYearMonth",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "ChannelId",
"name": "channelid",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Username",
"name": "username",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Year",
"name": "year",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Month",
"name": "month",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channelid/{channelid}/user/{user}/random": {
"get": {
"description": "Get a random line from a user in a given channel",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelIdUserLogsRandom",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "ChannelId",
"name": "channelid",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Username",
"name": "username",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channelid/{channelid}/userid/{userid}": {
"get": {
"description": "Get user logs in channel of current month",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelIdUserIdLogs",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "ChannelId",
"name": "channelid",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "UserId",
"name": "userid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channelid/{channelid}/userid/{userid}/random": {
"get": {
"description": "Get a random line from a user in a given channel",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelIdUserIdLogsRandom",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "ChannelId",
"name": "channelid",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "UserId",
"name": "userid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channelid/{channelid}/userid/{userid}/{year}/{month}": {
"get": {
"description": "Get user logs in channel of given year month",
"produces": [
"application/json",
"text/plain"
],
"tags": [
"logs"
],
"operationId": "channelIdUserIdLogsYearMonth",
"parameters": [
{
"type": "string",
"x-go-name": "Json",
"name": "json",
"in": "query"
},
{
"type": "string",
"x-go-name": "Reverse",
"name": "reverse",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "From",
"name": "from",
"in": "query"
},
{
"type": "integer",
"format": "int32",
"x-go-name": "To",
"name": "to",
"in": "query"
},
{
"type": "string",
"x-go-name": "ChannelId",
"name": "channelid",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "UserId",
"name": "userid",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Year",
"name": "year",
"in": "path",
"required": true
},
{
"type": "string",
"x-go-name": "Month",
"name": "month",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "chatLog",
"schema": {
"$ref": "#/definitions/chatLog"
}
}
}
}
},
"/channels": {
"get": {
"description": "List currently logged channels",
"produces": [
"application/json",
"text/plain"
],
"schemes": [
"https"
],
"tags": [
"justlog"
],
"operationId": "channels",
"responses": {
"200": {
"description": "AllChannelsJSON",
"schema": {
"$ref": "#/definitions/AllChannelsJSON"
}
}
}
}
},
"/list": {
"get": {
"description": "Lists available logs of a user",
"produces": [
"application/json",
"text/plain"
],
"schemes": [
"https"
],
"tags": [
"logs"
],
"operationId": "list",
"parameters": [
{
"type": "string",
"x-go-name": "Channel",
"name": "channel",
"in": "query"
},
{
"type": "string",
"x-go-name": "Username",
"name": "username",
"in": "query"
},
{
"type": "string",
"x-go-name": "ChannelId",
"name": "channelid",
"in": "query"
},
{
"type": "string",
"x-go-name": "Userid",
"name": "userid",
"in": "query"
}
],
"responses": {
"200": {
"description": "logList",
"schema": {
"$ref": "#/definitions/logList"
}
}
}
}
}
},
"definitions": {
"AllChannelsJSON": {
"type": "object",
"properties": {
"channels": {
"type": "array",
"items": {
"$ref": "#/definitions/channel"
},
"x-go-name": "Channels"
}
},
"x-go-package": "github.com/gempir/justlog/api"
},
"MessageType": {
"description": "MessageType different message types possible to receive via IRC",
"type": "integer",
"format": "int64",
"x-go-package": "github.com/gempir/go-twitch-irc/v2"
},
"Time": {
"description": "Programs using times should typically store and pass them as values,\nnot pointers. That is, time variables and struct fields should be of\ntype time.Time, not *time.Time.\n\nA Time value can be used by multiple goroutines simultaneously except\nthat the methods GobDecode, UnmarshalBinary, UnmarshalJSON and\nUnmarshalText are not concurrency-safe.\n\nTime instants can be compared using the Before, After, and Equal methods.\nThe Sub method subtracts two instants, producing a Duration.\nThe Add method adds a Time and a Duration, producing a Time.\n\nThe zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC.\nAs this time is unlikely to come up in practice, the IsZero method gives\na simple way of detecting a time that has not been initialized explicitly.\n\nEach Time has associated with it a Location, consulted when computing the\npresentation form of the time, such as in the Format, Hour, and Year methods.\nThe methods Local, UTC, and In return a Time with a specific location.\nChanging the location in this way changes only the presentation; it does not\nchange the instant in time being denoted and therefore does not affect the\ncomputations described in earlier paragraphs.\n\nRepresentations of a Time value saved by the GobEncode, MarshalBinary,\nMarshalJSON, and MarshalText methods store the Time.Location's offset, but not\nthe location name. They therefore lose information about Daylight Saving Time.\n\nIn addition to the required “wall clock” reading, a Time may contain an optional\nreading of the current process's monotonic clock, to provide additional precision\nfor comparison or subtraction.\nSee the “Monotonic Clocks” section in the package documentation for details.\n\nNote that the Go == operator compares not just the time instant but also the\nLocation and the monotonic clock reading. Therefore, Time values should not\nbe used as map or database keys without first guaranteeing that the\nidentical Location has been set for all values, which can be achieved\nthrough use of the UTC or Local method, and that the monotonic clock reading\nhas been stripped by setting t = t.Round(0). In general, prefer t.Equal(u)\nto t == u, since t.Equal uses the most accurate comparison available and\ncorrectly handles the case when only one of its arguments has a monotonic\nclock reading.",
"type": "string",
"format": "date-time",
"title": "A Time represents an instant in time with nanosecond precision."
},
"UserLogFile": {
"type": "object",
"properties": {
"month": {
"type": "string",
"x-go-name": "Month"
},
"year": {
"type": "string",
"x-go-name": "Year"
}
},
"x-go-package": "github.com/gempir/justlog/filelog"
},
"channel": {
"type": "object",
"properties": {
"name": {
"type": "string",
"x-go-name": "Name"
},
"userID": {
"type": "string",
"x-go-name": "UserID"
}
},
"x-go-package": "github.com/gempir/justlog/api"
},
"channelConfigsJoinRequest": {
"type": "object",
"properties": {
"channels": {
"description": "list of userIds",
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "Channels"
}
},
"x-go-package": "github.com/gempir/justlog/api"
},
"channelsDeleteRequest": {
"type": "object",
"properties": {
"channels": {
"description": "list of userIds",
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "Channels"
}
},
"x-go-package": "github.com/gempir/justlog/api"
},
"chatLog": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/chatMessage"
},
"x-go-name": "Messages"
}
},
"x-go-package": "github.com/gempir/justlog/api"
},
"chatMessage": {
"type": "object",
"properties": {
"channel": {
"type": "string",
"x-go-name": "Channel"
},
"displayName": {
"type": "string",
"x-go-name": "DisplayName"
},
"id": {
"type": "string",
"x-go-name": "ID"
},
"raw": {
"type": "string",
"x-go-name": "Raw"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-go-name": "Tags"
},
"text": {
"type": "string",
"x-go-name": "Text"
},
"timestamp": {
"$ref": "#/definitions/timestamp"
},
"type": {
"$ref": "#/definitions/MessageType"
},
"username": {
"type": "string",
"x-go-name": "Username"
}
},
"x-go-package": "github.com/gempir/justlog/api"
},
"logList": {
"type": "object",
"properties": {
"availableLogs": {
"type": "array",
"items": {
"$ref": "#/definitions/UserLogFile"
},
"x-go-name": "AvailableLogs"
}
},
"x-go-package": "github.com/gempir/justlog/api"
},
"timestamp": {
"type": "object",
"x-go-package": "github.com/gempir/justlog/api"
}
},
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"name": "X-Api-Key",
"in": "header"
}
}
}