Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API defines the structure for the API
func (*API) GetMetrics ¶
func (d *API) GetMetrics() (*UpdateUIResult, error)
GetMetrics makes web.update_ui request to Deluge and returns the result
type AuthRequest ¶
type AuthRequest struct { Params []string `json:"params"` BaseRequest }
AuthRequest defines the structure for the auth.login request to the API
type AuthResponse ¶
type AuthResponse struct { Result bool `json:"result"` BaseResponse }
AuthResponse defines the structure for auth.login response
type BaseRequest ¶
BaseRequest defines the structure for the base request to the API
type BaseResponse ¶
BaseResponse defines the base response from the API
type Deluge ¶
type Deluge struct { Host string `toml:"host"` Password string `toml:"password"` Log telegraf.Logger API *API }
Deluge defines the data structure for plugin
func (*Deluge) Description ¶
Description returns the plugin description
func (*Deluge) Gather ¶
func (d *Deluge) Gather(acc telegraf.Accumulator) error
Gather gathers and sends metrics to output
func (*Deluge) SampleConfig ¶
SampleConfig returns the sample config for the plugin
type FilterInfo ¶
FilterInfo defines the structure for a filter info in the result
func (*FilterInfo) UnmarshalJSON ¶
func (f *FilterInfo) UnmarshalJSON(p []byte) error
UnmarshalJSON unmarshalls a FilterInfo object
type Filters ¶
type Filters struct { State []FilterInfo `json:"state"` TrackerHost []FilterInfo `json:"tracker_host"` Owner []FilterInfo `json:"owner"` Label []FilterInfo `json:"label"` }
Filters defines the structure for filters in the result
type NoAuthError ¶
type NoAuthError struct{}
NoAuthError defines the structure for the Unauthenticated error
func (*NoAuthError) Error ¶
func (e *NoAuthError) Error() string
Error returns the Unauthenticated error
type Stats ¶
type Stats struct { MaxDownload float64 `json:"max_download"` MaxUpload float64 `json:"max_upload"` MaxNumConnections int `json:"max_num_connections"` NumConnections int `json:"num_connections"` UploadRate float64 `json:"upload_rate"` DownloadRate float64 `json:"download_rate"` DownloadProtocolRate float64 `json:"download_protocol_rate"` UploadProtocolRate float64 `json:"upload_protocol_rate"` DhtNodes int `json:"dht_nodes"` HasIncomingConnections int `json:"has_incoming_connections"` FreeSpace int64 `json:"free_space"` ExternalIP string `json:"external_ip"` }
Stats defines the structure for the overall stats in the result
type TorrentInfo ¶
type TorrentInfo struct { TimeAdded int `json:"time_added"` Name string `json:"name"` TotalDone int `json:"total_done"` Progress float64 `json:"progress"` State string `json:"state"` Ratio float64 `json:"ratio"` TotalSize int `json:"total_size"` TotalUploaded int64 `json:"total_uploaded"` TrackerHost string `json:"tracker_host"` }
TorrentInfo defines the structure for torrent info in the result
type Torrents ¶
type Torrents map[string]TorrentInfo
Torrents defines the structure for torrents info map in the result
type UpdateUIRequest ¶
type UpdateUIRequest struct { Params UpdateUIRequestParams `json:"params"` BaseRequest }
UpdateUIRequest defines the structure for the web.update_ui request to the API
type UpdateUIRequestParams ¶
UpdateUIRequestParams defines the structure for the web.update_ui request params
func (*UpdateUIRequestParams) MarshalJSON ¶
func (p *UpdateUIRequestParams) MarshalJSON() ([]byte, error)
MarshalJSON marshalls a UpdateUIRequestParams object to json
type UpdateUIResponse ¶
type UpdateUIResponse struct { Result *UpdateUIResult `json:"result"` BaseResponse }
UpdateUIResponse defines the structure for web.update_ui response