Documentation
¶
Overview ¶
This package contains the initialization code for the Deepgram Go SDK
Index ¶
Constants ¶
const ( LogLevelDefault = common.LogLevelDefault LogLevelErrorOnly = common.LogLevelErrorOnly LogLevelStandard = common.LogLevelStandard LogLevelElevated = common.LogLevelElevated LogLevelFull = common.LogLevelFull LogLevelDebug = common.LogLevelDebug LogLevelTrace = common.LogLevelTrace LogLevelVerbose = common.LogLevelVerbose )
Variables ¶
var ( // ErrInvalidInput required input was not found ErrInvalidInput = errors.New("required input was not found") )
Functions ¶
func Init ¶
func Init(init InitLib)
The SDK Init function for this library. Allows you to set the logging level and use of a log file. Default is output to the stdout.
func InitWithDefault ¶
func InitWithDefault()
InitWithDefault is the SDK Init function for this library using default values.
Types ¶
type Client ¶
Client implements helper functionality for Prerecorded API
func New ¶
func New(apiKey string, options *ClientOptions) *Client
New creates a new websocket connection with the specified options
Input parameters: - ctx: context.Context object - apiKey: string containing the Deepgram API key - options: ClientOptions which allows overriding things like hostname, version of the API, etc.
func NewWithDefaults ¶
func NewWithDefaults() *Client
NewWithDefaults creates a new websocket connection with all default options
Notes:
- The Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY
func (*Client) Do ¶
Do is a generic REST API call to the platform
Input parameters: - req: http.Request object
Output parameters: - resBody: interface{} which will be populated with the response from the server
func (*Client) DoFile ¶
func (c *Client) DoFile(ctx context.Context, filePath string, req interfaces.PreRecordedTranscriptionOptions, resBody interface{}) error
DoFile posts a file capturing a conversation to a given REST endpoint
Input parameters: - filePath: string containing the path to the file to be posted - req: PreRecordedTranscriptionOptions which allows overriding things like language, etc.
Output parameters: - resBody: interface{} which will be populated with the response from the server
func (*Client) DoStream ¶
func (c *Client) DoStream(ctx context.Context, src io.Reader, options interfaces.PreRecordedTranscriptionOptions, resBody interface{}) error
DoStream posts a stream capturing a conversation to a given REST endpoint
Input parameters: - src: io.Reader containing the stream to be posted - req: PreRecordedTranscriptionOptions which allows overriding things like language, etc.
Output parameters: - resBody: interface{} which will be populated with the response from the server
func (*Client) DoURL ¶
func (c *Client) DoURL(ctx context.Context, url string, options interfaces.PreRecordedTranscriptionOptions, resBody interface{}) error
DoURL posts a URL capturing a conversation to a given REST endpoint
Input parameters: - url: string containing the URL to be posted - req: PreRecordedTranscriptionOptions which allows overriding things like language, etc.
Output parameters: - resBody: interface{} which will be populated with the response from the server
type ClientOptions ¶
ClientOptions defines any options for the client