Documentation
¶
Index ¶
- Variables
- type APIClient
- func (c APIClient) CheckMagnet(params *CheckMagnetParams) (request.APIResponse[store.CheckMagnetData], error)
- func (c *APIClient) HaltCheckMagnet()
- func (c *APIClient) IsHaltedCheckMagnet() bool
- func (c APIClient) Request(method, path string, params request.Context, v ResponseEnvelop) (*http.Response, error)
- func (c APIClient) TrackMagnet(params *TrackMagnetParams) (request.APIResponse[TrackMagnetData], error)
- type APIClientConfig
- type CheckMagnetParams
- type Ctx
- type Response
- type ResponseEnvelop
- type ResponseError
- type TrackMagnetData
- type TrackMagnetParams
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultHTTPClient = func() *http.Client { transport := config.DefaultHTTPTransport.Clone() transport.Proxy = config.Tunnel.GetProxy(config.TUNNEL_TYPE_NONE) return &http.Client{ Transport: transport, Timeout: 60 * time.Second, } }()
Functions ¶
This section is empty.
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) CheckMagnet ¶
func (c APIClient) CheckMagnet(params *CheckMagnetParams) (request.APIResponse[store.CheckMagnetData], error)
func (*APIClient) HaltCheckMagnet ¶
func (c *APIClient) HaltCheckMagnet()
func (*APIClient) IsHaltedCheckMagnet ¶
func (APIClient) TrackMagnet ¶
func (c APIClient) TrackMagnet(params *TrackMagnetParams) (request.APIResponse[TrackMagnetData], error)
type APIClientConfig ¶
type CheckMagnetParams ¶
type CheckMagnetParams struct { store.CheckMagnetParams StoreName store.StoreName StoreToken string }
type Response ¶
type Response[D any] struct { Data D `json:"data,omitempty"` Error *ResponseError `json:"error,omitempty"` }
type ResponseEnvelop ¶
type ResponseEnvelop interface {
GetError() error
}
type ResponseError ¶
type ResponseError struct { Code core.ErrorCode `json:"code"` Message string `json:"message"` StatusCode int `json:"status_code"` }
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
type TrackMagnetData ¶
type TrackMagnetData struct{}
type TrackMagnetParams ¶
type TrackMagnetParams struct { store.Ctx StoreName store.StoreName `json:"-"` StoreToken string `json:"-"` // single Hash string `json:"hash"` Files []store.MagnetFile `json:"files"` IsMiss bool `json:"is_miss"` SId string `json:"sid"` // bulk FilesByHash map[string][]store.MagnetFile `json:"files_by_hash"` }
Click to show internal directories.
Click to hide internal directories.