Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// The application id.
//
// read only: true
// required: true
// example: 5
ID uint `gorm:"primary_key;unique_index;AUTO_INCREMENT" json:"id"`
// The application token. Can be used as `appToken`. See Authentication.
//
// read only: true
// required: true
// example: AWH0wZ5r0Mbac.r
Token string `gorm:"unique_index" json:"token"`
UserID uint `gorm:"index" json:"-"`
// The application name. This is how the application should be displayed to the user.
//
// required: true
// example: Backup Server
Name string `gorm:"type:text" form:"name" query:"name" json:"name" binding:"required"`
// The description of the application.
//
// required: true
// example: Backup server for the interwebs
Description string `gorm:"type:text" form:"description" query:"description" json:"description"`
// Whether the application is an internal application. Internal applications should not be deleted.
//
// read only: true
// required: true
// example: false
Internal bool `form:"internal" query:"internal" json:"internal"`
// The image of the application.
//
// read only: true
// required: true
// example: image/image.jpeg
Image string `gorm:"type:text" json:"image"`
Messages []MessageExternal `json:"-"`
}
Application Model
The Application holds information about an app which can send notifications.
swagger:model Application
type Client ¶
type Client struct {
// The client id.
//
// read only: true
// required: true
// example: 5
ID uint `gorm:"primary_key;unique_index;AUTO_INCREMENT" json:"id"`
// The client token. Can be used as `clientToken`. See Authentication.
//
// read only: true
// required: true
// example: CWH0wZ5r0Mbac.r
Token string `gorm:"unique_index" json:"token"`
UserID uint `gorm:"index" json:"-"`
// The client name. This is how the client should be displayed to the user.
//
// required: true
// example: Android Phone
Name string `gorm:"type:text" form:"name" query:"name" json:"name" binding:"required"`
}
Client Model
The Client holds information about a device which can receive notifications (and other stuff).
swagger:model Client
type Error ¶
type Error struct {
// The general error message
//
// required: true
// example: Unauthorized
Error string `json:"error"`
// The http error code.
//
// required: true
// example: 401
ErrorCode int `json:"errorCode"`
// The http error code.
//
// required: true
// example: you need to provide a valid access token or user credentials to access this api
ErrorDescription string `json:"errorDescription"`
}
Error Model
The Error contains error relevant information.
swagger:model Error
type MessageExternal ¶
type MessageExternal struct {
// The message id.
//
// read only: true
// required: true
// example: 25
ID uint `json:"id"`
// The application id that send this message.
//
// read only: true
// required: true
// example: 5
ApplicationID uint `json:"appid"`
// The message. Markdown (excluding html) is allowed.
//
// required: true
// example: **Backup** was successfully finished.
Message string `form:"message" query:"message" json:"message" binding:"required"`
// The title of the message.
//
// example: Backup
Title string `form:"title" query:"title" json:"title"`
// The priority of the message.
//
// example: 2
Priority int `form:"priority" query:"priority" json:"priority"`
// The extra data sent along the message.
//
// The extra fields are stored in a key-value scheme. Only accepted in CreateMessage requests with application/json content-type.
//
// The keys should be in the following format: <top-namespace>::[<sub-namespace>::]<action>
//
// These namespaces are reserved and might be used in the official clients: gotify android ios web server client. Do not use them for other purposes.
//
// example: {"home::appliances::thermostat::change_temperature":{"temperature":23},"home::appliances::lighting::on":{"brightness":15}}
Extras map[string]interface{} `form:"-" query:"-" json:"extras,omitempty"`
// The date the message was created.
//
// read only: true
// required: true
// example: 2018-02-27T19:36:10.5045044+01:00
Date time.Time `json:"date"`
}
MessageExternal Model
The MessageExternal holds information about a message which was sent by an Application.
swagger:model Message
type PagedMessages ¶
type PagedMessages struct {
// The paging of the messages.
//
// read only: true
// required: true
Paging Paging `json:"paging"`
// The messages.
//
// read only: true
// required: true
Messages []*MessageExternal `json:"messages"`
}
PagedMessages Model
Wrapper for the paging and the messages ¶
swagger:model PagedMessages
type Paging ¶
type Paging struct {
// The request url for the next page. Empty/Null when no next page is available.
//
// read only: true
// required: false
// example: http://example.com/message?limit=50&since=123456
Next string `json:"next,omitempty"`
// The amount of messages that got returned in the current request.
//
// read only: true
// required: true
// example: 5
Size int `json:"size"`
// The ID of the last message returned in the current request. Use this as alternative to the next link.
//
// read only: true
// required: true
// example: 5
// min: 0
Since uint `json:"since"`
// The limit of the messages for the current request.
//
// read only: true
// required: true
// min: 1
// max: 200
// example: 123
Limit int `json:"limit"`
}
Paging Model
The Paging holds holds information about the limit and making requests to the next page.
swagger:model Paging
type PluginConfExternal ¶
type PluginConfExternal struct {
// The plugin id.
//
// read only: true
// required: true
// example: 25
ID uint `json:"id"`
// The plugin name.
//
// read only: true
// required: true
// example: RSS poller
Name string `json:"name"`
// The user name. For login.
//
// required: true
// example: P1234
Token string `binding:"required" json:"token" query:"token" form:"token"`
// The module path of the plugin.
//
// example: github.com/gotify/server/plugin/example/echo
// read only: true
// required: true
ModulePath string `json:"modulePath" form:"modulePath" query:"modulePath"`
// The author of the plugin.
//
// example: jmattheis
// read only: true
Author string `json:"author,omitempty" form:"author" query:"author"`
// The website of the plugin.
//
// example: gotify.net
// read only: true
Website string `json:"website,omitempty" form:"website" query:"website"`
// The license of the plugin.
//
// example: MIT
// read only: true
License string `json:"license,omitempty" form:"license" query:"license"`
// Whether the plugin instance is enabled.
//
// example: true
// required: true
Enabled bool `json:"enabled"`
// Capabilities the plugin provides
//
// example: ["webhook","display"]
// required: true
Capabilities []string `json:"capabilities"`
}
PluginConfExternal Model
Holds information about a plugin instance for one user.
swagger:model PluginConf
type UserExternal ¶
type UserExternal struct {
// The user id.
//
// read only: true
// required: true
// example: 25
ID uint `json:"id"`
// The user name. For login.
//
// required: true
// example: unicorn
Name string `binding:"required" json:"name" query:"name" form:"name"`
// If the user is an administrator.
//
// example: true
Admin bool `json:"admin" form:"admin" query:"admin"`
}
UserExternal Model
The User holds information about permission and other stuff.
swagger:model User
type UserExternalPass ¶
type UserExternalPass struct {
// The user password. For login.
//
// required: true
// example: nrocinu
Pass string `json:"pass,omitempty" form:"pass" query:"pass" binding:"required"`
}
UserExternalPass Model
The Password for updating the user.
swagger:model UserPass
type UserExternalWithPass ¶
type UserExternalWithPass struct {
UserExternal
UserExternalPass
}
UserExternalWithPass Model
The UserWithPass holds information about the credentials and other stuff.
swagger:model UserWithPass
type VersionInfo ¶
type VersionInfo struct {
// The current version.
//
// required: true
// example: 5.2.6
Version string `json:"version"`
// The git commit hash on which this binary was built.
//
// required: true
// example: ae9512b6b6feea56a110d59a3353ea3b9c293864
Commit string `json:"commit"`
// The date on which this binary was built.
//
// required: true
// example: 2018-02-27T19:36:10.5045044+01:00
BuildDate string `json:"buildDate"`
}
VersionInfo Model
swagger:model VersionInfo