Documentation
¶
Index ¶
- Constants
- Variables
- func UpstreamErrorWithCause(cause error) *core.UpstreamError
- type APIClient
- func (c APIClient) CheckCache(params *CheckCacheParams) (APIResponse[CheckCacheData], error)
- func (c APIClient) CreateDirectDownloadLink(params *CreateDirectDownloadLinkParams) (APIResponse[CreateDirectDownloadLinkData], error)
- func (c APIClient) CreateFolder(params *CreateFolderParams) (APIResponse[CreateFolderData], error)
- func (c APIClient) CreateTransfer(params *CreateTransferParams) (APIResponse[CreateTransferData], error)
- func (c APIClient) DeleteFolder(params *DeleteFolderParams) (APIResponse[DeleteFolderData], error)
- func (c APIClient) DeleteTransfer(params *DeleteTransferParams) (APIResponse[DeleteTransferData], error)
- func (c APIClient) GetAccountInfo(params *GetAccountInfoParams) (APIResponse[GetAccountInfoData], error)
- func (c APIClient) GetItem(params *GetItemParams) (APIResponse[GetItemData], error)
- func (c APIClient) ListFolders(params *ListFoldersParams) (APIResponse[ListFoldersData], error)
- func (c APIClient) ListItems(params *ListItemsParams) (APIResponse[ListItemsData], error)
- func (c APIClient) ListTransfers(params *ListTransfersParams) (APIResponse[ListTransfersData], error)
- func (c APIClient) Request(method, path string, params request.Context, v ResponseEnvelop) (*http.Response, error)
- func (c APIClient) SearchFolders(params *SearchFoldersParams) (APIResponse[SearchFoldersData], error)
- type APIClientConfig
- type APIResponse
- type CachedMagnetId
- type CheckCacheData
- type CheckCacheParams
- type CreateDirectDownloadLinkData
- type CreateDirectDownloadLinkDataContent
- type CreateDirectDownloadLinkParams
- type CreateFolderData
- type CreateFolderParams
- type CreateTransferData
- type CreateTransferParams
- type Ctx
- type DeleteFolderData
- type DeleteFolderParams
- type DeleteTransferData
- type DeleteTransferParams
- type FolderItemType
- type GetAccountInfoData
- type GetAccountInfoParams
- type GetItemData
- type GetItemParams
- type ListFolderDataBreadcrumbItem
- type ListFolderDataContentItem
- type ListFoldersData
- type ListFoldersParams
- type ListItemsData
- type ListItemsDataFile
- type ListItemsParams
- type ListTransfersData
- type ListTransfersDataItem
- type ListTransfersParams
- type ResponseContainer
- type ResponseEnvelop
- type ResponseStatus
- type SearchFoldersData
- type SearchFoldersParams
- 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
- type TranscodeStatus
- type TransferStatus
- type VirusScan
Constants ¶
View Source
const CachedMagnetIdPrefix = "premiumize:cached:magnet:"
Variables ¶
View Source
var DefaultHTTPClient = config.DefaultHTTPClient
Functions ¶
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) CheckCache ¶
func (c APIClient) CheckCache(params *CheckCacheParams) (APIResponse[CheckCacheData], error)
func (APIClient) CreateDirectDownloadLink ¶
func (c APIClient) CreateDirectDownloadLink(params *CreateDirectDownloadLinkParams) (APIResponse[CreateDirectDownloadLinkData], error)
func (APIClient) CreateFolder ¶
func (c APIClient) CreateFolder(params *CreateFolderParams) (APIResponse[CreateFolderData], error)
func (APIClient) CreateTransfer ¶
func (c APIClient) CreateTransfer(params *CreateTransferParams) (APIResponse[CreateTransferData], error)
func (APIClient) DeleteFolder ¶
func (c APIClient) DeleteFolder(params *DeleteFolderParams) (APIResponse[DeleteFolderData], error)
func (APIClient) DeleteTransfer ¶
func (c APIClient) DeleteTransfer(params *DeleteTransferParams) (APIResponse[DeleteTransferData], error)
also deletes the folder
func (APIClient) GetAccountInfo ¶
func (c APIClient) GetAccountInfo(params *GetAccountInfoParams) (APIResponse[GetAccountInfoData], error)
func (APIClient) GetItem ¶
func (c APIClient) GetItem(params *GetItemParams) (APIResponse[GetItemData], error)
func (APIClient) ListFolders ¶
func (c APIClient) ListFolders(params *ListFoldersParams) (APIResponse[ListFoldersData], error)
func (APIClient) ListItems ¶
func (c APIClient) ListItems(params *ListItemsParams) (APIResponse[ListItemsData], error)
func (APIClient) ListTransfers ¶
func (c APIClient) ListTransfers(params *ListTransfersParams) (APIResponse[ListTransfersData], error)
func (APIClient) SearchFolders ¶
func (c APIClient) SearchFolders(params *SearchFoldersParams) (APIResponse[SearchFoldersData], error)
type APIClientConfig ¶
type CachedMagnetId ¶
type CachedMagnetId string
type CheckCacheData ¶
type CheckCacheParams ¶
type CreateDirectDownloadLinkData ¶
type CreateDirectDownloadLinkData struct {
Location string `json:"location"`
Filename string `json:"filename"`
Filesize int `json:"filesize"`
Content []CreateDirectDownloadLinkDataContent `json:"content"`
}
type CreateDirectDownloadLinkDataContent ¶
type CreateDirectDownloadLinkDataContent struct {
Path string `json:"path"`
Size int64 `json:"size"`
Link string `json:"link"`
StreamLink string `json:"stream_link"`
TranscodeStatus TranscodeStatus `json:"transcode_status"`
}
func (CreateDirectDownloadLinkDataContent) GetName ¶
func (f CreateDirectDownloadLinkDataContent) GetName() string
func (CreateDirectDownloadLinkDataContent) GetPath ¶
func (f CreateDirectDownloadLinkDataContent) GetPath() string
type CreateFolderData ¶
type CreateFolderData struct {
Id string `json:"id"`
}
type CreateFolderParams ¶
type CreateTransferData ¶
type CreateTransferParams ¶
type CreateTransferParams struct {
Ctx
Src string
File *multipart.FileHeader
FolderId string
}
type DeleteFolderData ¶
type DeleteFolderData struct {
}
type DeleteFolderParams ¶
type DeleteTransferData ¶
type DeleteTransferData struct{}
type DeleteTransferParams ¶
type FolderItemType ¶
type FolderItemType string
const ( FolderItemTypeFolder FolderItemType = "folder" FolderItemTypeFile FolderItemType = "file" )
type GetAccountInfoData ¶
type GetAccountInfoParams ¶
type GetAccountInfoParams struct {
Ctx
}
type GetItemData ¶
type GetItemData struct {
Id string `json:"id"`
UserId int `json:"user_id"`
CustomerId int `json:"customer_id"`
Name string `json:"name"`
Size int64 `json:"size"`
CreatedAt int64 `json:"created_at"`
TranscodeStatus string `json:"transcode_status"` // pending / good_as_is
FolderId string `json:"folder_id"`
ServerName string `json:"server_name"`
ACodec string `json:"acodec"`
VCodec string `json:"vcodec"`
MimeType string `json:"mime_type"`
OpensubtitlesHash string `json:"opensubtitles_hash"`
ResX string `json:"resx"`
ResY string `json:"resy"`
Duration string `json:"duration"`
VirusScan VirusScan `json:"virus_scan"`
AudioTrackNames []string `json:"audio_track_names"`
CRC32 string `json:"crc32"`
Type string `json:"type"`
Link string `json:"link"`
DirectLink string `json:"directlink"`
StreamLink string `json:"streamlink,omitempty"`
Unpackable bool `json:"unpackable"`
}
func (GetItemData) GetCreatedAt ¶
func (d GetItemData) GetCreatedAt() time.Time
type GetItemParams ¶
type ListFolderDataContentItem ¶
type ListFolderDataContentItem struct {
Id string `json:"id"`
Name string `json:"name"`
Type FolderItemType `json:"type"`
Size int64 `json:"size"`
CreatedAt int64 `json:"created_at"`
MimeType string `json:"mime_type"`
TranscodeStatus TranscodeStatus `json:"transcode_status"`
Link string `json:"link"`
StreamLink string `json:"stream_link"`
VirusScan VirusScan `json:"virus_scan"`
}
func (ListFolderDataContentItem) GetAddedAt ¶
func (c ListFolderDataContentItem) GetAddedAt() time.Time
type ListFoldersData ¶
type ListFoldersData struct {
Content []ListFolderDataContentItem `json:"content"`
Breadcrumbs []ListFolderDataBreadcrumbItem `json:"breadcrumbs"`
Name string `json:"name"`
ParentId string `json:"parent_id"`
FolderId string `json:"folder_id"`
}
type ListFoldersParams ¶
type ListItemsData ¶
type ListItemsData struct {
Files []ListItemsDataFile
}
type ListItemsDataFile ¶
type ListItemsDataFile struct {
Id string `json:"id"`
Name string `json:"name"`
CreatedAt int64 `json:"created_at"`
Size int64 `json:"size"`
MimeType string `json:"mime_type"`
VirusScan VirusScan
Path string
}
func (ListItemsDataFile) GetCreatedAt ¶
func (c ListItemsDataFile) GetCreatedAt() time.Time
type ListItemsParams ¶
type ListItemsParams struct {
Ctx
}
type ListTransfersData ¶
type ListTransfersData struct {
Transfers []ListTransfersDataItem `json:"transfers"`
}
type ListTransfersDataItem ¶
type ListTransfersDataItem struct {
Id string `json:"id"`
Name string `json:"name"`
Message string `json:"message"`
Status TransferStatus `json:"status"`
Progress float32 `json:"progress"`
Src string `json:"src"`
FolderId string `json:"folder_id"`
FileId string `json:"file_id"`
}
func (ListTransfersDataItem) GetAddedAt ¶
func (t ListTransfersDataItem) GetAddedAt() time.Time
type ListTransfersParams ¶
type ListTransfersParams struct {
Ctx
}
type ResponseContainer ¶
type ResponseContainer struct {
Status ResponseStatus `json:"status"`
Message string `json:"message,omitempty"`
}
func (*ResponseContainer) Error ¶
func (e *ResponseContainer) Error() string
func (*ResponseContainer) GetError ¶
func (r *ResponseContainer) GetError() *ResponseContainer
func (*ResponseContainer) GetStatus ¶
func (r *ResponseContainer) GetStatus() ResponseStatus
type ResponseEnvelop ¶
type ResponseEnvelop interface {
GetStatus() ResponseStatus
GetError() *ResponseContainer
}
type ResponseStatus ¶
type ResponseStatus string
const ( ResponseStatusSuccess ResponseStatus = "success" ResponseStatusError ResponseStatus = "error" )
type SearchFoldersData ¶
type SearchFoldersData struct {
Content []ListFolderDataContentItem `json:"content"`
}
type SearchFoldersParams ¶
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 ¶
type TranscodeStatus ¶
type TranscodeStatus string
const ( TranscodeStatusError TranscodeStatus = "error" TranscodeStatusFetchPending TranscodeStatus = "fetch_pending" TranscodeStatusFinished TranscodeStatus = "finished" TranscodeStatusGoodAsIs TranscodeStatus = "good_as_is" TranscodeStatusNotApplicable TranscodeStatus = "not_applicable" TranscodeStatusPending TranscodeStatus = "pending" TranscodeStatusRunning TranscodeStatus = "running" )
type TransferStatus ¶
type TransferStatus string
const ( TransferStatusBanned TransferStatus = "banned" TransferStatusDeleted TransferStatus = "deleted" TransferStatusError TransferStatus = "error" TransferStatusFinished TransferStatus = "finished" TransferStatusQueued TransferStatus = "queued" TransferStatusRunning TransferStatus = "running" TransferStatusSeeding TransferStatus = "seeding" TransferStatusTimeout TransferStatus = "timeout" TransferStatusWaiting TransferStatus = "waiting" )
Click to show internal directories.
Click to hide internal directories.