Documentation
¶
Overview ¶
This package handles the versioning in the API for the various clients (prerecorded, live, etc.)
Index ¶
- Constants
- Variables
- func GetAnalyzeAPI(ctx context.Context, host, version, path string, ...) (string, error)
- func GetLiveAPI(ctx context.Context, host, version, path string, ...) (string, error)
- func GetManageAPI(ctx context.Context, host, version, path string, vals interface{}, ...) (string, error)
- func GetPrerecordedAPI(ctx context.Context, host, version, path string, ...) (string, error)
- func GetSpeakAPI(ctx context.Context, host, version, path string, ...) (string, error)
- func GetSpeakStreamAPI(ctx context.Context, host, version, path string, ...) (string, error)
Constants ¶
const ( // APIProtocol default protocol HTTPProtocol string = "https" // WSProtocol default protocol WSProtocol string = "wss" // APIPathListen APIPathListen string = "listen" // APITypeLive APITypeLive string = "live" // APITypeSpeakStream APITypeSpeakStream string = "speak-stream" )
const ( // LiveAPIVersion current supported version LiveAPIVersion string = "v1" // LivePath is the current path for live transcription LivePath string = "listen" )
const ( // version ManageAPIVersion string = "v1" // balances BalancesURI string = "projects/%s/balances" BalancesByIDURI string = "projects/%s/balances/%s" // invitations InvitationsURI string = "projects/%s/invites" InvitationsByIDURI string = "projects/%s/invites/%s" InvitationsLeaveURI string = "projects/%s/leave" // Keys KeysURI string = "projects/%s/keys" KeysByIDURI string = "projects/%s/keys/%s" // Members MembersURI string = "projects/%s/members" MembersByIDURI string = "projects/%s/members/%s" // models ModelsURI string = "models" ModelsByIDURI string = "models/%s" ModelsProjectURI string = "projects/%s/models" ModelsProjectByIDURI string = "projects/%s/models/%s" // projects ProjectsURI string = "projects" ProjectsByIDURI string = "projects/%s" // scopes MembersScopeByIDURI string = "projects/%s/members/%s/scopes" // usage UsageRequestURI string = "projects/%s/requests" UsageRequestByIDURI string = "projects/%s/requests/%s" UsageURI string = "projects/%s/usage" UsageFieldsURI string = "projects/%s/usage/fields" )
const ( // SpeakStreamAPIVersion current supported version SpeakStreamAPIVersion string = "v1" // SpeakStreamPath is the current path SpeakStreamPath string = "speak-stream" )
const ( // DefaultAPIVersion is the current supported default version for APIs DefaultAPIVersion string = "v1" )
Variables ¶
var ( // ErrInvalidPath invalid path ErrInvalidPath = errors.New("invalid path") // APIPathMap maps the API types to their default paths APIPathMap = map[string]string{ "analyze": "read", "prerecorded": APIPathListen, "speak": "speak", "speak-stream": "speak", "manage": "", "live": APIPathListen, } )
Functions ¶
func GetAnalyzeAPI ¶ added in v1.1.0
func GetAnalyzeAPI(ctx context.Context, host, version, path string, options *interfaces.AnalyzeOptions, args ...interface{}) (string, error)
GetAnalyzeAPI is a function which controls the versioning of the live transcription API and provides mechanism for:
- overriding the host endpoint - overriding the version used - overriding the endpoint path - additional arguments to the query string/parameters
The return value is the complete URL endpoint to be used for the live transcription
func GetLiveAPI ¶
func GetLiveAPI(ctx context.Context, host, version, path string, options *interfaces.LiveTranscriptionOptions, args ...interface{}) (string, error)
GetLiveAPI is a function which controls the versioning of the live transcription API and provides mechanism for:
- overriding the host endpoint - overriding the version used - overriding the endpoint path - additional arguments to the query string/parameters
The return value is the complete URL endpoint to be used for the live transcription
func GetManageAPI ¶
func GetManageAPI(ctx context.Context, host, version, path string, vals interface{}, args ...interface{}) (string, error)
GetManageAPI is a function which controls the versioning of the manage API and provides mechanism for:
- overriding the host endpoint - overriding the version used - overriding the endpoint path - additional arguments to the query string/parameters
The return value is the complete URL endpoint to be used for manage
func GetPrerecordedAPI ¶
func GetPrerecordedAPI(ctx context.Context, host, version, path string, options *interfaces.PreRecordedTranscriptionOptions, args ...interface{}) (string, error)
GetPrerecordedAPI is a function which controls the versioning of the live transcription API and provides mechanism for:
- overriding the host endpoint - overriding the version used - overriding the endpoint path - additional arguments to the query string/parameters
The return value is the complete URL endpoint to be used for the live transcription
func GetSpeakAPI ¶ added in v1.2.0
func GetSpeakAPI(ctx context.Context, host, version, path string, options *interfaces.SpeakOptions, args ...interface{}) (string, error)
GetSpeakAPI is a function which controls the versioning of the live transcription API and provides mechanism for:
- overriding the host endpoint - overriding the version used - overriding the endpoint path - additional arguments to the query string/parameters
The return value is the complete URL endpoint to be used for the live transcription
func GetSpeakStreamAPI ¶ added in v1.4.0
func GetSpeakStreamAPI(ctx context.Context, host, version, path string, options *interfaces.SpeakOptions, args ...interface{}) (string, error)
GetSpeakStreamAPI is a function which controls the versioning of the text-to-speech API and provides mechanism for:
- overriding the host endpoint - overriding the version used - overriding the endpoint path - additional arguments to the query string/parameters
The return value is the complete URL endpoint to be used for the text-to-speech
Types ¶
This section is empty.