Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/revdotcom/revai-go
Rev.ai golang client
https://github.com/revdotcom/revai-go
client golang http-cl rev-ai revai
Last synced: 4 days ago
JSON representation
Rev.ai golang client
- Host: GitHub
- URL: https://github.com/revdotcom/revai-go
- Owner: revdotcom
- License: mit
- Created: 2020-04-28T02:26:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-26T19:54:45.000Z (9 months ago)
- Last Synced: 2024-06-20T11:07:09.293Z (5 months ago)
- Topics: client, golang, http-cl, rev-ai, revai
- Language: Go
- Homepage: https://www.rev.ai/docs
- Size: 548 KB
- Stars: 21
- Watchers: 5
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Rev.ai
[![Go Report Card](https://goreportcard.com/badge/github.com/threeaccents/revai-go)](https://goreportcard.com/report/github.com/threeaccents/revai-go)
[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/threeaccents/revai-go)A [Rev.ai](https://rev.ai) Go client library.
## Installation
Install revai-go with:
```sh
go get -u github.com/threeaccents/revai-go
```Then, import it using:
``` go
import (
"github.com/threeaccents/revai-go"
)
```## Documentation
For details on all the functionality in this library, see the [GoDoc](http://godoc.org/github.com/threeaccents/revai-go)
documentation.Below are a few simple examples:
### New Client
```go
// default client
c := revai.NewClient("API-KEY")
```### New Client With Options
```go
httpClient := &http.Client{
Timeout: 30 * time.Second,
}c := revai.NewClient(
"API_KEY",
revai.HTTPClient(httpClient),
revai.UserAgent("my-user-agent"),
)
```### Submit Local File Job
```go
params := &revai.NewFileJobParams{
Media: f, // some io.Reader
Filename: f.Name(),
}ctx := context.Background()
job, err := c.Job.SubmitFile(ctx, params)
// handle errfmt.Println("status", job.Status)
```### Submit Url Job
```go
const mediaURL = "https://support.rev.com/hc/en-us/article_attachments/200043975/FTC_Sample_1_-_Single.mp3"params := &revai.NewURLJobParams{
MediaURL: mediaURL,
}ctx := context.Background()
job, err := c.Job.SubmitURL(ctx, params)
// handle errfmt.Println("status", job.Status)
```### Caption
```go
params := &revai.GetCaptionParams{
JobID: "job-id"
}ctx := context.Background()
caption, err := c.Caption.Get(ctx, params)
// error checkfmt.Println("srt caption", caption.Value)
```### Account
```go
ctx := context.Background()account, err := c.Account.Get(ctx)
// error checkfmt.Println("balance", account.BalanceSeconds)
```### Stream
[streaming example](examples/streaming/stream.go)