Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pierre-emmanuelJ/open-alldebrid
Alldebrid OpenAPI based Golang client wrapper
https://github.com/pierre-emmanuelJ/open-alldebrid
alldebrid alldebrid-api alldebrid-wrapper api api-client client golang golang-bindings golang-wrapper openapi openapi-spec openapi-specification openapi3
Last synced: 11 days ago
JSON representation
Alldebrid OpenAPI based Golang client wrapper
- Host: GitHub
- URL: https://github.com/pierre-emmanuelJ/open-alldebrid
- Owner: pierre-emmanuelJ
- License: gpl-3.0
- Created: 2022-01-14T13:00:45.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-19T16:27:47.000Z (almost 3 years ago)
- Last Synced: 2024-10-31T10:51:25.472Z (15 days ago)
- Topics: alldebrid, alldebrid-api, alldebrid-wrapper, api, api-client, client, golang, golang-bindings, golang-wrapper, openapi, openapi-spec, openapi-specification, openapi3
- Language: HTML
- Homepage: https://pierre-emmanuelj.github.io/open-alldebrid/
- Size: 3.14 MB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Open Alldebrid
Alldebrid OpenAPI Golang wrapper
The Golang wrapper is generated from an [OpenAPI3 spec](./alldebrid.yaml) based on the official Alldebrid.com [Documentation](https://docs.alldebrid.com/#general-informations)
Open Alldebrid Swagger-ui [Visit here](https://pierre-emmanuelj.github.io/open-alldebrid/)
This [OpenAPI spec](./alldebrid.yaml) can be used to generate client library in other languages!
## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
- API version: 4.0.0
- Package version: 1.0.0## Installation
Install the following dependencies:
```shell
go get "github.com/pierre-emmanuelJ/open-alldebrid"
```Add the following import:
```golang
import "github.com/pierre-emmanuelJ/open-alldebrid/client"
```## Examples
```Golang
package mainimport (
"context"
"fmt"
"os""github.com/pierre-emmanuelJ/open-alldebrid/client"
)func main() {
agent := "agent_example" // Your software user-agent. (default to "open-alldebrid")configuration := client.NewConfiguration()
configuration.AddDefaultHeader("Authorization", "Bearer ApiKeyFromAlldebrid")
api_client := client.NewAPIClient(configuration)resp, r, err := api_client.DefaultApi.UserGet(context.Background()).Agent(agent).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UserGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}fmt.Printf("%#v\n", resp)
}
```Possible to add Bearer Token from context
```Golang
package mainimport (
"context"
"fmt"
"os""github.com/pierre-emmanuelJ/open-alldebrid/client"
)func main() {
agent := "agent_example" // Your software user-agent. (default to "open-alldebrid")
auth := context.WithValue(
context.Background(),
openapiclient.ContextAccessToken, "ApiKeyFromAlldebrid",
)configuration := client.NewConfiguration()
api_client := client.NewAPIClient(configuration)resp, r, err := api_client.DefaultApi.UserGet(auth).Agent(agent).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UserGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}fmt.Printf("%#v\n", resp)
}
```## Documentation for API Endpoints
Find all the API Documentation [here](./docs/DefaultApi.md)
Swagger UI [here](https://pierre-emmanuelj.github.io/open-alldebrid/)
You can execute HTTP request from the UI with your [Alldebrid ApiKey](https://alldebrid.com/apikeys/)
## Documentation For Authorization
### bearerAuth
- **Type**: HTTP Bearer token authentication
Example
```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ApiKeyFromAlldebrid")configuration := client.NewConfiguration()
api_client := client.NewAPIClient(configuration)resp, r, err := api_client.DefaultApi.UserGet(auth).Agent(agent).Execute()
```## Powered by
* [openapi-generator](https://github.com/OpenAPITools/openapi-generator)