Categorygithub.com/descriptinc/revai-go
modulepackage
0.0.16
Repository: https://github.com/descriptinc/revai-go.git
Documentation: pkg.go.dev

# README

Go Rev.ai

Go Report Card GoDoc

A Rev.ai Go client library.

Installation

Install revai-go with:

go get -u github.com/descriptinc/revai-go

Then, import it using:

import (
    "github.com/descriptinc/revai-go"
)

Documentation

For details on all the functionality in this library, see the GoDoc documentation.

Below are a few simple examples:

New Client

// default client
c := revai.NewClient("API-KEY")

New Client With Options

httpClient := &http.Client{
    Timeout: 30 * time.Second,
}

c := revai.NewClient(
    "API_KEY",
    revai.HTTPClient(httpClient),
    revai.UserAgent("my-user-agent"),
)

Submit Local File Job

params := &revai.NewFileJobParams{
	Media:    f, // some io.Reader
	Filename: f.Name(),
}

ctx := context.Background()

job, err := c.Job.SubmitFile(ctx, params)
// handle err

fmt.Println("status", job.Status)

Submit Url Job

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 err

fmt.Println("status", job.Status)

Caption

params := &revai.GetCaptionParams{
	JobID: "job-id"
}

ctx := context.Background()

caption, err := c.Caption.Get(ctx, params)
// error check

fmt.Println("srt caption", caption.Value)

Account

ctx := context.Background()

account, err := c.Account.Get(ctx)
// error check

fmt.Println("balance", account.BalanceSeconds)

Stream

streaming example

# Packages

No description provided by the author

# Functions

BaseURL sets the base url for the rev.ai client.
HTTPClient sets the http client for the rev.ai client.
IsRevError Check if the code is a Rev error if so return it.
NewClient creates a new client and sets defaults.
UserAgent sets the user agent for the rev.ai client.

# Constants

Error codes.
Error codes.
Error codes.
Error codes.
Error codes.
Error codes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Account is the developer's account information.
Caption output for a transcription job.
A Client manages communication with the Rev.ai API.
Conn represents a websocket connection to the Rev.ai Api.
CreateCustomVocabularyParams specifies the parameters to the CustomVocabularyService.Create method.
CustomVocabulary represents a Rev.ai custom vocabulary.
DeleteCustomVocabularyParams specifies the parameters to the CustomVocabularyService.Delete method.
DeleteJobParams specifies the parameters to the JobService.Delete method.
DialStreamParams specifies the parameters to the StreamService.Dial method.
Element represents a Rev.ai element.
ErrBadStatusCode is returned when the API returns a non 2XX error code.
GetCaptionParams specifies the parameters to the CaptionService.Get method.
GetCustomVocabularyParams specifies the parameters to the CustomVocabularyService.Get method.
GetJobParams specifies the parameters to the JobService.Get method.
GetTranscriptParams specifies the parameters to the TranscriptService.Get method.
Job represents a rev.ai async job.
No description provided by the author
JobOptions specifies the options to the JobService.SubmitFile method.
ListCustomVocabularyParams specifies the parameters to the CustomVocabularyService.List method.
ListJobParams specifies the optional query parameters to the JobService.List method.
Monologue represents a Rev.ai monologue.
NewFileJobParams specifies the parameters to the JobService.SubmitFile method.
NewURLJobParams specifies the parameters to the JobService.SubmitURL method.
No description provided by the author
RetriableError represnts retriable stream error.
RevError represents a close message from rev see https://www.rev.ai/docs/streaming#section/Error-Codes.
StreamMessage represents a rev.ai websocket stream message.
TextTranscript represents a Rev.ai job text transcript.
Transcript represents a Rev.ai job json transcript.

# Type aliases

AccountService provides access to the account related functions in the Rev.ai API.
CaptionService provides access to the caption related functions in the Rev.ai API.
No description provided by the author
CustomVocabularyService provides access to the custom vocabulary related functions in the Rev.ai API.
JobService provides access to the jobs related functions in the Rev.ai API.
StreamService provides access to the stream related functions in the Rev.ai API.
TranscriptService provides access to the transcript related functions in the Rev.ai API.