Documentation
¶
Index ¶
- Constants
- Variables
- func TranslateErrorCode(errorCode ErrorCode) core.ErrorCode
- func UpstreamErrorWithCause(cause error) *core.UpstreamError
- type APIClient
- func (c APIClient) AddSeedboxTorrent(params *AddSeedboxTorrentParams) (APIResponse[AddSeedboxTorrentData], error)
- func (c APIClient) CheckSeedboxTorrentsCached(params *CheckSeedboxTorrentsCachedParams) (APIResponse[CheckSeedboxTorrentsCachedData], error)deprecated
- func (c APIClient) GetAccountInfo(params *GetAccountInfoParams) (APIResponse[GetAccountInfoData], error)
- func (c APIClient) ListSeedboxTorrents(params *ListSeedboxTorrentsParams) (APIResponse[ListSeedboxTorrentsData], error)
- func (c APIClient) RemoveSeedboxTorrents(params *RemoveSeedboxTorrentParams) (APIResponse[RemoveSeedboxTorrentData], error)
- func (c APIClient) Request(method, path string, params request.Context, v ResponseEnvelop) (*http.Response, error)
- type APIClientConfig
- type APIResponse
- type AddSeedboxTorrentBody
- type AddSeedboxTorrentData
- type AddSeedboxTorrentParams
- type CheckSeedboxTorrentsCachedData
- type CheckSeedboxTorrentsCachedParams
- type CheckSeedboxTorrentsCachedTorrent
- type CheckSeedboxTorrentsCachedTorrentFile
- type Ctx
- type ErrorCode
- type GetAccountInfoData
- type GetAccountInfoDataSettings
- type GetAccountInfoParams
- type ListSeedboxTorrentsData
- type ListSeedboxTorrentsParams
- type PaginatedResponse
- type RemoveSeedboxTorrentData
- type RemoveSeedboxTorrentParams
- type RequestContext
- type Response
- type ResponseEnvelop
- type ResponseError
- type ResponsePagination
- type SeedboxTorrent
- type SeedboxTorrentFile
- type SeedboxTorrentStructureType
- type SeedboxTorrentTracker
- type StoreClient
- func (c *StoreClient) AddMagnet(params *store.AddMagnetParams) (*store.AddMagnetData, error)
- func (c *StoreClient) CheckMagnet(params *store.CheckMagnetParams) (*store.CheckMagnetData, error)
- func (c *StoreClient) GenerateLink(params *store.GenerateLinkParams) (*store.GenerateLinkData, error)
- func (c *StoreClient) GetMagnet(params *store.GetMagnetParams) (*store.GetMagnetData, error)
- func (c *StoreClient) GetName() store.StoreName
- func (c *StoreClient) GetUser(params *store.GetUserParams) (*store.User, error)
- func (c *StoreClient) ListMagnets(params *store.ListMagnetsParams) (*store.ListMagnetsData, error)
- func (c *StoreClient) RemoveMagnet(params *store.RemoveMagnetParams) (*store.RemoveMagnetData, error)
- type StoreClientConfig
Constants ¶
View Source
const ( SeedboxTorrentStructureTypeList = "list" SeedboxTorrentStructureTypeTree = "tree" )
View Source
const LIST_SEEDBOX_TORRENTS_PER_PAGE_MAX = 100
View Source
const LIST_SEEDBOX_TORRENTS_PER_PAGE_MIN = 20
Variables ¶
View Source
var DefaultHTTPClient = config.DefaultHTTPClient
Functions ¶
func TranslateErrorCode ¶
func UpstreamErrorWithCause ¶
func UpstreamErrorWithCause(cause error) *core.UpstreamError
Types ¶
type APIClient ¶
type APIClient struct {
BaseURL *url.URL
HTTPClient *http.Client
// contains filtered or unexported fields
}
func NewAPIClient ¶
func NewAPIClient(conf *APIClientConfig) *APIClient
func (APIClient) AddSeedboxTorrent ¶
func (c APIClient) AddSeedboxTorrent(params *AddSeedboxTorrentParams) (APIResponse[AddSeedboxTorrentData], error)
func (APIClient) CheckSeedboxTorrentsCached
deprecated
func (c APIClient) CheckSeedboxTorrentsCached(params *CheckSeedboxTorrentsCachedParams) (APIResponse[CheckSeedboxTorrentsCachedData], error)
Deprecated: Debrid-Link removed the endpoint
func (APIClient) GetAccountInfo ¶
func (c APIClient) GetAccountInfo(params *GetAccountInfoParams) (APIResponse[GetAccountInfoData], error)
func (APIClient) ListSeedboxTorrents ¶
func (c APIClient) ListSeedboxTorrents(params *ListSeedboxTorrentsParams) (APIResponse[ListSeedboxTorrentsData], error)
func (APIClient) RemoveSeedboxTorrents ¶
func (c APIClient) RemoveSeedboxTorrents(params *RemoveSeedboxTorrentParams) (APIResponse[RemoveSeedboxTorrentData], error)
type APIClientConfig ¶
type AddSeedboxTorrentBody ¶
type AddSeedboxTorrentBody struct {
Url string `json:"rl"` // torrent url, magnet or hash
Wait bool `json:"wait"` // wait before starting the torrent to select files. default: false
Async bool `json:"async"` // If true, won't wait metadata before returning result, recommended. default: false
StructureType SeedboxTorrentStructureType `json:"structureType,omitempty"`
}
type AddSeedboxTorrentData ¶
type AddSeedboxTorrentData = SeedboxTorrent
type AddSeedboxTorrentParams ¶
type AddSeedboxTorrentParams struct {
Ctx
Url string `json:"url"` // torrent url, magnet or hash
File *multipart.FileHeader `json:"-"` // File MUST use "multipart/form-data" content-type
Wait bool `json:"wait"` // wait before starting the torrent to select files. default: false
StructureType SeedboxTorrentStructureType `json:"structureType,omitempty"` // Files structure type. list or tree. Default to list
IP string `json:"ip,omitempty"`
}
type CheckSeedboxTorrentsCachedData ¶
type CheckSeedboxTorrentsCachedData = map[string]CheckSeedboxTorrentsCachedTorrent
type CheckSeedboxTorrentsCachedTorrent ¶
type CheckSeedboxTorrentsCachedTorrent struct {
Name string `json:"name"`
HashString string `json:"hashString"`
Files []CheckSeedboxTorrentsCachedTorrentFile `json:"files"`
}
type ErrorCode ¶
const ( ErrorCodeBadToken ErrorCode = "badToken" ErrorCodeBadSign ErrorCode = "badSign" ErrorCodeHidedToken ErrorCode = "hidedToken" ErrorCodeServerError ErrorCode = "server_error" ErrorCodeAccessDenied ErrorCode = "access_denied" ErrorCodeAuthorizationPending ErrorCode = "authorization_pending" ErrorCodeUnsupportedGrantType ErrorCode = "unsupported_grant_type" ErrorCodeUnsupportedResponseType ErrorCode = "unsupported_response_type" ErrorCodeInvalidRequest ErrorCode = "invalid_request" ErrorCodeInvalidScope ErrorCode = "invalid_scope" ErrorCodeExpiredToken ErrorCode = "expired_token" ErrorCodeInvalidClient ErrorCode = "invalid_client" ErrorCodeUnknowR ErrorCode = "unknowR" ErrorCodeInternalError ErrorCode = "internalError" ErrorCodeBadArguments ErrorCode = "badArguments" ErrorCodeBadId ErrorCode = "badId" ErrorCodeFloodDetected ErrorCode = "floodDetected" ErrorCodeServerNotAllowed ErrorCode = "serverNotAllowed" ErrorCodeFreeServerOverload ErrorCode = "freeServerOverload" ErrorCodeMaxAttempts ErrorCode = "maxAttempts" ErrorCodeCaptchaRequired ErrorCode = "captchaRequired" ErrorCodeAccountLocked ErrorCode = "accountLocked" ErrorCodeNotDebrid ErrorCode = "notDebrid" ErrorCodeHostNotValid ErrorCode = "hostNotValid" ErrorCodeFileNotFound ErrorCode = "fileNotFound" ErrorCodeFileNotAvailable ErrorCode = "fileNotAvailable" ErrorCodeBadFileUrl ErrorCode = "badFileUrl" ErrorCodeBadFilePassword ErrorCode = "badFilePassword" ErrorCodeNotFreeHost ErrorCode = "notFreeHost" ErrorCodeMaintenanceHost ErrorCode = "maintenanceHost" ErrorCodeNoServerHost ErrorCode = "noServerHost" ErrorCodeMaxLink ErrorCode = "maxLink" ErrorCodeMaxLinkHost ErrorCode = "maxLinkHost" ErrorCodeMaxData ErrorCode = "maxData" ErrorCodeMaxDataHost ErrorCode = "maxDataHost" ErrorCodeDisabledServerHost ErrorCode = "disabledServerHost" ErrorCodeNotAddTorrent ErrorCode = "notAddTorrent" ErrorCodeTorrentTooBig ErrorCode = "torrentTooBig" ErrorCodeMaxTorrent ErrorCode = "maxTorrent" ErrorCodeMaxTransfer ErrorCode = "maxTransfer" )
type GetAccountInfoData ¶
type GetAccountInfoData struct {
Email string `json:"email"`
EmailVerified bool `json:"emailVerified"`
AccountType int `json:"accountType"`
PremiumLeft int `json:"premiumLeft"`
Pts int `json:"pts"`
VouchersUrl string `json:"vouchersUrl"`
EditPasswordUrl string `json:"editPasswordUrl"`
EditEmailUrl string `json:"editEmailUrl"`
ViewSessidUrl string `json:"viewSessidUrl"`
UpgradeAccountUrl string `json:"upgradeAccountUrl"`
RegisterDate string `json:"registerDate"`
ServerDetected bool `json:"serverDetected"`
Settings GetAccountInfoDataSettings `json:"settings"`
AvatarUrl string `json:"avatarUrl"`
Username string `json:"username"`
}
type GetAccountInfoDataSettings ¶
type GetAccountInfoDataSettings struct {
Https bool `json:"https"`
ThemeDark bool `json:"themeDark"`
HideOldLinks bool `json:"hideOldLinks"`
Cdn string `json:"cdn"`
TwofaType string `json:"twofaType"`
EmailsNews bool `json:"emailsNews"`
EmailsAccount bool `json:"emailsAccount"`
EmailsSupport bool `json:"emailsSupport"`
}
type GetAccountInfoParams ¶
type GetAccountInfoParams struct {
Ctx
}
type ListSeedboxTorrentsData ¶
type ListSeedboxTorrentsData struct {
Value []SeedboxTorrent
Pagination ResponsePagination
}
type PaginatedResponse ¶
type PaginatedResponse[T any] struct { Response[[]T] Pagination ResponsePagination `json:"pagination"` }
type RemoveSeedboxTorrentData ¶
type RemoveSeedboxTorrentData = []string
type RequestContext ¶
type Response ¶
type Response[T any] struct { *ResponseError Success bool `json:"success"` Value T `json:"value,omitempty"` }
func (Response[any]) GetError ¶
func (r Response[any]) GetError() *ResponseError
type ResponseEnvelop ¶
type ResponseEnvelop interface {
IsSuccess() bool
GetError() *ResponseError
}
type ResponseError ¶
type ResponseError struct {
Err ErrorCode `json:"error,omitempty"`
ErrId string `json:"error_id,omitempty"`
ErrDesc string `json:"error_description,omitempty"`
}
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
type ResponsePagination ¶
type SeedboxTorrent ¶
type SeedboxTorrent struct {
Id string `json:"id"`
Name string `json:"name"`
Error int `json:"error"`
ErrorString string `json:"errorString"`
HashString string `json:"hashString"`
UploadRatio float64 `json:"uploadRatio"`
ServerId string `json:"serverId"`
Wait bool `json:"wait"`
Downloaded bool `json:"downloaded"`
PeersConnected int `json:"peersConnected"`
Status int `json:"status"`
ActProgress bool `json:"act_progress"`
TotalSize int64 `json:"totalSize"`
Files []SeedboxTorrentFile `json:"files"`
Trackers []SeedboxTorrentTracker `json:"trackers"`
IsZip bool `json:"isZip"`
Created int64 `json:"created"`
DownloadPercent int `json:"downloadPercent"`
DownloadSpeed int `json:"downloadSpeed"`
UploadSpeed int `json:"uploadSpeed"`
}
func (SeedboxTorrent) GetAddedAt ¶
func (t SeedboxTorrent) GetAddedAt() time.Time
type SeedboxTorrentFile ¶
type SeedboxTorrentStructureType ¶
type SeedboxTorrentStructureType string
type SeedboxTorrentTracker ¶
type SeedboxTorrentTracker struct {
Announce string `json:"announce"`
}
type StoreClient ¶
func NewStoreClient ¶
func NewStoreClient(config *StoreClientConfig) *StoreClient
func (*StoreClient) AddMagnet ¶
func (c *StoreClient) AddMagnet(params *store.AddMagnetParams) (*store.AddMagnetData, error)
func (*StoreClient) CheckMagnet ¶
func (c *StoreClient) CheckMagnet(params *store.CheckMagnetParams) (*store.CheckMagnetData, error)
func (*StoreClient) GenerateLink ¶
func (c *StoreClient) GenerateLink(params *store.GenerateLinkParams) (*store.GenerateLinkData, error)
func (*StoreClient) GetMagnet ¶
func (c *StoreClient) GetMagnet(params *store.GetMagnetParams) (*store.GetMagnetData, error)
func (*StoreClient) GetName ¶
func (c *StoreClient) GetName() store.StoreName
func (*StoreClient) GetUser ¶
func (c *StoreClient) GetUser(params *store.GetUserParams) (*store.User, error)
func (*StoreClient) ListMagnets ¶
func (c *StoreClient) ListMagnets(params *store.ListMagnetsParams) (*store.ListMagnetsData, error)
func (*StoreClient) RemoveMagnet ¶
func (c *StoreClient) RemoveMagnet(params *store.RemoveMagnetParams) (*store.RemoveMagnetData, error)
type StoreClientConfig ¶
Click to show internal directories.
Click to hide internal directories.