Documentation ¶
Index ¶
- func CheckMAC(message, messageMAC, key string) bool
- func HMAC(message, key string) string
- func ReadFromFile(filePath string) []byte
- func SaveToFile(filePath string, data []byte) error
- type Client
- type Site
- type SiteCollection
- func (sc *SiteCollection) Clear()
- func (sc *SiteCollection) Get(idx int) *Site
- func (sc *SiteCollection) Index(s *Site) int
- func (sc *SiteCollection) Insert(i int, s *Site)
- func (sc *SiteCollection) Length() int
- func (sc *SiteCollection) MarshalJSON() ([]byte, error)
- func (sc *SiteCollection) Pop(s *Site)
- func (sc *SiteCollection) Push(s *Site)
- func (sc *SiteCollection) Remove(i int)
- func (sc *SiteCollection) Shift(s *Site)
- func (sc *SiteCollection) UnmarshalJSON(data []byte) error
- func (sc *SiteCollection) Unshift(s *Site)
- type Torrent
- type TorrentCollection
- func (tc *TorrentCollection) Clear()
- func (tc *TorrentCollection) Get(idx int) *Torrent
- func (tc *TorrentCollection) Index(t *Torrent) int
- func (tc *TorrentCollection) Insert(i int, t *Torrent)
- func (tc *TorrentCollection) Length() int
- func (tc *TorrentCollection) MarshalJSON() ([]byte, error)
- func (tc *TorrentCollection) Pop(t *Torrent)
- func (tc *TorrentCollection) Push(t *Torrent)
- func (tc *TorrentCollection) Remove(i int)
- func (tc *TorrentCollection) Shift(t *Torrent)
- func (tc *TorrentCollection) UnmarshalJSON(data []byte) error
- func (tc *TorrentCollection) Unshift(t *Torrent)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMAC ¶
CheckMAC confirms that the mac provided with a message was signed with the appropriate key. The mac should be in a hex string.
func ReadFromFile ¶
ReadFromFile returns the bytes from 'filePath'
func SaveToFile ¶
SaveToFile saves 'data' to the file 'filePath'
Types ¶
type Client ¶
Client provides methods for talking to a magopie server.
func (*Client) Download ¶
Download triggers the Magopie server to download a particular torrent by ID.
func (*Client) ListSites ¶
func (c *Client) ListSites() *SiteCollection
ListSites returns a collection of the sites that the server knows about
func (*Client) Search ¶
func (c *Client) Search(s string) *TorrentCollection
Search asks the Magopie server for a list of results
type SiteCollection ¶
type SiteCollection struct {
// contains filtered or unexported fields
}
SiteCollection is a collection of sites because gomobile can't handle slices
func (*SiteCollection) Get ¶
func (sc *SiteCollection) Get(idx int) *Site
Get returns the site at idx or a nil site
func (*SiteCollection) Index ¶
func (sc *SiteCollection) Index(s *Site) int
Index finds the index of a site or -1 if not found
func (*SiteCollection) Insert ¶
func (sc *SiteCollection) Insert(i int, s *Site)
Insert inserts a site into the collection at i
func (*SiteCollection) Length ¶
func (sc *SiteCollection) Length() int
Length returns how many sites are in the collection
func (*SiteCollection) MarshalJSON ¶
func (sc *SiteCollection) MarshalJSON() ([]byte, error)
MarshalJSON returns JSON from the collection
func (*SiteCollection) Pop ¶
func (sc *SiteCollection) Pop(s *Site)
Pop removes the last element from the collection
func (*SiteCollection) Push ¶
func (sc *SiteCollection) Push(s *Site)
Push adds an element to the end of the collection
func (*SiteCollection) Remove ¶
func (sc *SiteCollection) Remove(i int)
Remove a site from the collection at i
func (*SiteCollection) Shift ¶
func (sc *SiteCollection) Shift(s *Site)
Shift removes an element from the front of the collection
func (*SiteCollection) UnmarshalJSON ¶
func (sc *SiteCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON replaces the collection with the results from a JSON []byte
func (*SiteCollection) Unshift ¶
func (sc *SiteCollection) Unshift(s *Site)
Unshift adds an element to the front of the collection
type Torrent ¶
type Torrent struct { ID string Title string MagnetURI string SiteID string Seeders int Leechers int Size int }
A Torrent is an individual result from a search operation representing a single torrent file.
type TorrentCollection ¶
type TorrentCollection struct {
// contains filtered or unexported fields
}
TorrentCollection is a collection of torrents because gomobile can't handle slices
func (*TorrentCollection) Clear ¶
func (tc *TorrentCollection) Clear()
Clear empties the list of torrents
func (*TorrentCollection) Get ¶
func (tc *TorrentCollection) Get(idx int) *Torrent
Get returns the torrent at idx or a nil torrent
func (*TorrentCollection) Index ¶
func (tc *TorrentCollection) Index(t *Torrent) int
Index finds the index of a torrent or -1 if not found
func (*TorrentCollection) Insert ¶
func (tc *TorrentCollection) Insert(i int, t *Torrent)
Insert inserts a torrent into the collection at i
func (*TorrentCollection) Length ¶
func (tc *TorrentCollection) Length() int
Length returns how many torrents are in the collection
func (*TorrentCollection) MarshalJSON ¶
func (tc *TorrentCollection) MarshalJSON() ([]byte, error)
MarshalJSON returns JSON from the collection
func (*TorrentCollection) Pop ¶
func (tc *TorrentCollection) Pop(t *Torrent)
Pop removes the last element from the collection
func (*TorrentCollection) Push ¶
func (tc *TorrentCollection) Push(t *Torrent)
Push adds an element to the end of the collection
func (*TorrentCollection) Remove ¶
func (tc *TorrentCollection) Remove(i int)
Remove a torrent from the collection at i
func (*TorrentCollection) Shift ¶
func (tc *TorrentCollection) Shift(t *Torrent)
Shift removes an element from the front of the collection
func (*TorrentCollection) UnmarshalJSON ¶
func (tc *TorrentCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON replaces the collection with the results from a JSON []byte
func (*TorrentCollection) Unshift ¶
func (tc *TorrentCollection) Unshift(t *Torrent)
Unshift adds an element to the front of the collection
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
android
Package android holds the native android client that talks to the server using go bindings.
|
Package android holds the native android client that talks to the server using go bindings. |
magopie
GET /torrents?q=ubuntu POST /download/{id}
|
GET /torrents?q=ubuntu POST /download/{id} |