apiService

package
v0.0.0-...-5607d3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrApiKey = errors.New("incorrect api key")
View Source
var ErrCategory = errors.New("this category doesn't exist")
View Source
var ErrHash = errors.New("incorrect hash")
View Source
var ErrMagnet = errors.New("incorrect magnet")
View Source
var ErrRights = errors.New("not enough rights for this request")
View Source
var ErrShortName = errors.New("file name should be at least 100 characters long")
View Source
var ErrSubCategory = errors.New("this sub category doesn't exist")
View Source
var ErrTorrentId = errors.New("torrent with requested id doesn't exist")

Functions

This section is empty.

Types

type TorrentRequest

type TorrentRequest struct {
	Name        string `json:"name"`
	Category    int    `json:"category"`
	SubCategory int    `json:"sub_category"`
	Magnet      string `json:"magnet"`
	Hash        string `json:"hash"`
	Description string `json:"description"`
}

accept torrent files?

func (*TorrentRequest) ValidateMultipartUpload

func (r *TorrentRequest) ValidateMultipartUpload(req *http.Request) (int64, error, int)

func (*TorrentRequest) ValidateUpdate

func (r *TorrentRequest) ValidateUpdate() (err error, code int)

func (*TorrentRequest) ValidateUpload

func (r *TorrentRequest) ValidateUpload() (err error, code int)

type TorrentsRequest

type TorrentsRequest struct {
	Query      torrentsQuery `json:"search"`
	Page       int           `json:"page"`
	MaxPerPage int           `json:"limit"`
}

func (*TorrentsRequest) ToParams

func (r *TorrentsRequest) ToParams() serviceBase.WhereParams

type UpdateRequest

type UpdateRequest struct {
	ID     int            `json:"id"`
	Update TorrentRequest `json:"update"`
}

func (*UpdateRequest) UpdateTorrent

func (r *UpdateRequest) UpdateTorrent(t *model.Torrent)

rewrite with reflect ?

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL