api

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileData

type FileData struct {
	Name    string
	Content []byte
}

FileData contains name and data

type StatusData

type StatusData struct {
	ID             string
	Text           string
	Completed      bool
	ErrorCode      string
	Error          string
	Status         string
	Progress       int
	AudioReady     bool
	AvResults      []string
	RecognizedText string `json:"recognizedText,omitempty"`
}

StatusData keeps structure for status method

type Transcriber

type Transcriber interface {
	Upload(ctx context.Context, audioFunc func(context.Context) (*UploadData, func(), error)) (string, error)
	HookToStatus(ctx context.Context, ID string) (<-chan StatusData, func(), error)
	GetStatus(ctx context.Context, ID string) (*StatusData, error)
	GetAudio(ctx context.Context, ID string) (*FileData, error)
	GetResult(ctx context.Context, ID, name string) (*FileData, error)
	Clean(ctx context.Context, ID string) error
}

Transcriber provides transcription

type UploadData

type UploadData struct {
	Params map[string]string
	Files  map[string]io.Reader
}

UploadData keeps structure for upload method

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL