Documentation ¶
Index ¶
- func CheckTrackers(trackers []string) []string
- type ReassignForm
- type TorrentRequest
- func (r *TorrentRequest) ExtractCategory() error
- func (r *TorrentRequest) ExtractLanguage() error
- func (r *TorrentRequest) ValidateDescription() error
- func (r *TorrentRequest) ValidateHash() error
- func (r *TorrentRequest) ValidateMagnet() error
- func (r *TorrentRequest) ValidateMultipartUpload(c *gin.Context, uploadFormTorrent string) (multipart.File, error)
- func (r *TorrentRequest) ValidateName() error
- func (r *TorrentRequest) ValidateWebsiteLink() error
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckTrackers ¶
CheckTrackers : Check if there is good trackers in torrent
Types ¶
type ReassignForm ¶
ReassignForm : Structure for reassign Form used by the reassign page
func (*ReassignForm) ExtractInfo ¶
func (f *ReassignForm) ExtractInfo(c *gin.Context) bool
ExtractInfo : Function to assign values from request to ReassignForm
type TorrentRequest ¶
type TorrentRequest struct { Name string `validate:"required" form:"name" json:"name,omitempty"` Magnet string `json:"magnet,omitempty" form:"magnet"` Category string `validate:"required" form:"c" json:"c"` Remake bool `json:"remake,omitempty" form:"remake"` Description string `json:"desc,omitempty" form:"desc"` Status int `json:"status,omitempty" form:"status"` Hidden bool `json:"hidden,omitempty" form:"hidden"` CaptchaID string `json:"-" form:"captchaID"` WebsiteLink string `validate:"uri" json:"website_link,omitempty" form:"website_link"` SubCategory int `json:"sub_category,omitempty" form:"sub_category"` Languages []string `json:"languages,omitempty" form:"languages"` Infohash string `json:"hash,omitempty" form:"hash"` CategoryID int `json:"-" form:"category_id"` SubCategoryID int `json:"-" form:"subcategory_id"` Filesize int64 `json:"filesize,omitempty"` Filepath string `json:"-"` FileList []uploadedFile `json:"filelist,omitempty"` Trackers []string `json:"trackers,omitempty"` }
TorrentRequest struct Same json name as the constant!
func (*TorrentRequest) ExtractCategory ¶
func (r *TorrentRequest) ExtractCategory() error
ExtractCategory : takes an http request and computes category field for this form
func (*TorrentRequest) ExtractLanguage ¶
func (r *TorrentRequest) ExtractLanguage() error
ExtractLanguage : takes a http request, computes the torrent language from the form.
func (*TorrentRequest) ValidateDescription ¶
func (r *TorrentRequest) ValidateDescription() error
func (*TorrentRequest) ValidateHash ¶
func (r *TorrentRequest) ValidateHash() error
func (*TorrentRequest) ValidateMagnet ¶
func (r *TorrentRequest) ValidateMagnet() error
func (*TorrentRequest) ValidateMultipartUpload ¶
func (r *TorrentRequest) ValidateMultipartUpload(c *gin.Context, uploadFormTorrent string) (multipart.File, error)
ValidateMultipartUpload : Check if multipart upload is valid
func (*TorrentRequest) ValidateName ¶
func (r *TorrentRequest) ValidateName() error
func (*TorrentRequest) ValidateWebsiteLink ¶
func (r *TorrentRequest) ValidateWebsiteLink() error
type UpdateRequest ¶
type UpdateRequest struct { ID uint `json:"id"` Update TorrentRequest `json:"update"` }
UpdateRequest struct
Click to show internal directories.
Click to hide internal directories.