func (tc *TorrentCollection) Push(t *Torrent) {
	tc.Insert(tc.Length(), t)
}
Push adds an element to the end of the collection
package magopie
import (
	"encoding/json"
	"fmt"
)
type Torrent struct {
	ID        string
	Title     string
	MagnetURI string
	SiteID    string
	Seeders   int
	Leechers  int
	Size      int
}
type TorrentCollection struct {
	list []Torrent
}
func (tc *TorrentCollection) Length() int {
	return len(tc.list)
}
func (tc *TorrentCollection) Get(idx int) *Torrent {
	if idx <= tc.Length() {
		return &tc.list[idx]
	}
	return nil
}
func (tc *TorrentCollection) Clear() {
	tc.list = tc.list[:0]
}
func (tc *TorrentCollection) Index(t *Torrent) int {
	for i, tst := range tc.list {
		if tst == *t {
			return i
		}
	}
	return -1
}
func (tc *TorrentCollection) Insert(i int, t *Torrent) {
	if i < 0 || i > tc.Length() {
		fmt.Printf("Magopie-go:: Attempted to insert a torrent at an invalid index")
		return
	}
	tc.list = append(tc.list, Torrent{})
	copy(tc.list[i+1:], tc.list[i:])
	tc.list[i] = *t
}
func (tc *TorrentCollection) Remove(i int) {
	if i < 0 || i >= tc.Length() {
		fmt.Printf("Magopie-go:: Attempted to remove a torrent from an invalid index")
		return
	}
	copy(tc.list[i:], tc.list[i+1:])
	tc.list[len(tc.list)-1] = Torrent{}
	tc.list = tc.list[:len(tc.list)-1]
}