Documentation ¶
Overview ¶
* irrenhaus-api, API wrapper for irrenhaus.dyndns.dk * Copyright (C) 2018 Daniel Müller * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>
Index ¶
- Constants
- Variables
- func CommentWrite(c *Connection, id int64, message string) (bool, error)
- func DownloadTorrent(c *Connection, id int64) ([]byte, string, error)
- func ShoutboxStrip(msg, url string) (stripped string)
- func ShoutboxWrite(c *Connection, shoutId int, message string) (bool, error)
- func Thank(c *Connection, id int64) (bool, error)
- type Connection
- type Cookies
- type Peer
- type ShoutboxEvent
- type ShoutboxMessage
- type Snatch
- type TorrentEntry
- type TorrentFile
- type TorrentList
- type TorrentUpload
Constants ¶
const ( ShoutboxEventNone = 0 ShoutboxEvent1 = 1 // if set, unread message count is in data[1] ShoutboxEventUserMessage = 2 ShoutboxEvent4 = 4 ShoutboxEvent8 = 8 ShoutboxEvent16 = 16 ShoutboxEvent32 = 32 // if set, one of the following to operations are possible // simple message delete: data[3] contains 'del,ID1,ID2,...' indicating which message should be deleted // clear entire chat: data[3] is 'clear' ShoutboxEventDeleteEntry = 64 )
Unnamed events are still unknown
Variables ¶
var DEBUG = false
Functions ¶
func CommentWrite ¶
func CommentWrite(c *Connection, id int64, message string) (bool, error)
func DownloadTorrent ¶
func DownloadTorrent(c *Connection, id int64) ([]byte, string, error)
func ShoutboxStrip ¶
Strip the HTML / format code from the message
func ShoutboxWrite ¶
func ShoutboxWrite(c *Connection, shoutId int, message string) (bool, error)
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(url string, username string, password string, pin string) Connection
func (Connection) GetCookies ¶
func (c Connection) GetCookies() Cookies
func (*Connection) Login ¶
func (c *Connection) Login() error
func (*Connection) SetCookies ¶
func (c *Connection) SetCookies(cookies Cookies)
func (*Connection) SetUserAgent ¶
func (c *Connection) SetUserAgent(userAgent string)
type ShoutboxEvent ¶
type ShoutboxMessage ¶
type ShoutboxMessage struct { Id int64 User string UserId int Date time.Time Message string Event *ShoutboxEvent }
func ShoutboxRead ¶
func ShoutboxRead(c *Connection, shoutId int, lastMessageId int64) ([]ShoutboxMessage, error)
type TorrentEntry ¶
type TorrentEntry struct { Id int Name string Category int Added time.Time Size uint64 Description string InfoHash string FileCount int SeederCount int LeecherCount int SnatchCount int CommentCount int Uploader string Files []TorrentFile Peers []Peer Snatches []Snatch }
func Details ¶
func Details(c *Connection, id int64, files bool, peers bool, snatches bool) (*TorrentEntry, error)
func Search ¶
func Search(c *Connection, needle string, categories []int, dead bool) ([]TorrentEntry, error)
type TorrentFile ¶
type TorrentList ¶
type TorrentList struct { Page int64 Entries []TorrentEntry }