This SDK is compatible with the following versions: Go >= 1.19.0
The torbox-api API uses an Access Token for authentication.
This token must be provided to authenticate your requests to the API.
When you initialize the SDK, you can set the access token as follows:
import (
"torbox-sdk-go/pkg/torboxapi"
"torbox-sdk-go/pkg/torboxapiconfig"
)
config := torboxapiconfig.NewConfig()
config.SetBearerToken("YOUR-TOKEN")
sdk := torboxapi.NewTorboxApi(config)
If you need to set or update the access token after initializing the SDK, you can use:
import (
"torbox-sdk-go/pkg/torboxapi"
"torbox-sdk-go/pkg/torboxapiconfig"
)
config := torboxapiconfig.NewConfig()
sdk := torboxapi.NewTorboxApi(config)
sdk.SetBearerToken("YOUR-TOKEN")
The SDK provides various services to interact with the API.
Below is a list of all available services with links to their detailed documentation:
Name |
---|
TorrentsService |
UsenetService |
WebDownloadsDebridService |
GeneralService |
NotificationsService |
UserService |
RssFeedsService |
IntegrationsService |
All services use response wrappers to provide a consistent interface to return the responses from the API.
The response wrapper itself is a generic struct that contains the response data and metadata.
Below are the response wrappers used in the SDK:
This response wrapper is used to return the response data from the API. It contains the following fields:
Name | Type | Description |
---|---|---|
Data | T |
The body of the API response |
Metadata | TorboxApiResponseMetadata |
Status code and headers returned by the API |
This response wrapper is used to return an error. It contains the following fields:
Name | Type | Description |
---|---|---|
Err | error |
The error that occurred |
Body | T |
The body of the API response |
Metadata | TorboxApiResponseMetadata |
Status code and headers returned by the API |
This struct is shared by both response wrappers and contains the following fields:
Name | Type | Description |
---|---|---|
Headers | map[string]string |
A map containing the headers returned by the API |
StatusCode | int |
The status code returned by the API |
The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.
Below is a list of all available models with links to their detailed documentation:
This SDK is licensed under the MIT License.
See the LICENSE file for more details.