Documentation ¶
Index ¶
- Variables
- func Align(s1 []string, s2 []string) ([]int, error)
- func FloatEquals(a, b float32) bool
- func IsRetryable(err error) bool
- func LogData(msg string, data string, err error)
- func RetrieveInfo(pr interface{}) string
- func RetryAll(err error) bool
- func ToDuration(ttsSteps int, sampleRate uint32, step int) time.Duration
- func ToTTSSteps(duration time.Duration, sampleRate uint32, step int) int
- type ErrBadAccent
- type ErrBadSymbols
- type ErrTextTooLong
- type ErrWordTooLong
- type HTTPBackoff
- type HTTPInvokerJSON
- type HTTPWrap
- type RequestTypeEnum
Constants ¶
This section is empty.
Variables ¶
var ErrNoInput = errors.New("no input")
ErrNoInput indicates no text input
var ErrNoRecord = errors.New("no record found")
ErrNoRecord indicates no record found error
var ErrTextDoesNotMatch = errors.New("wrong text")
ErrTextDoesNotMatch indicates old text does not match a new one
var MaxLogDataSize = 100
MaxLogDataSize indicates how many chars of data to log
Functions ¶
func FloatEquals ¶ added in v0.2.387
FloatEquals compares two floats
func IsRetryable ¶ added in v0.2.387
IsRetryable - check if error is retryable io.EOF or timeout
func RetrieveInfo ¶ added in v0.2.407
func RetrieveInfo(pr interface{}) string
RetrieveInfo invokes Info() if interface has one else returns ""
func ToDuration ¶ added in v0.7.0
Types ¶
type ErrBadAccent ¶
type ErrBadAccent struct {
BadAccents []string
}
ErrBadAccent indicate bad accent error
func NewErrBadAccent ¶
func NewErrBadAccent(badAccents []string) *ErrBadAccent
NewErrBadAccent creates new error
func (*ErrBadAccent) Error ¶
func (r *ErrBadAccent) Error() string
type ErrBadSymbols ¶ added in v0.4.0
type ErrBadSymbols struct {
Orig, Cleaned string
}
ErrBadSymbols indicates a word with wrong symbols
func NewErrBadSymbols ¶ added in v0.4.0
func NewErrBadSymbols(word, cleaned string) *ErrBadSymbols
NewErrBadSymbols creates new error
func (*ErrBadSymbols) Error ¶ added in v0.4.0
func (r *ErrBadSymbols) Error() string
type ErrTextTooLong ¶ added in v0.2.387
type ErrTextTooLong struct {
Max, Len int
}
ErrTextTooLong indicates too long input
func NewErrTextTooLong ¶ added in v0.2.387
func NewErrTextTooLong(len, max int) *ErrTextTooLong
NewErrTextTooLong creates new error
func (*ErrTextTooLong) Error ¶ added in v0.2.387
func (r *ErrTextTooLong) Error() string
type ErrWordTooLong ¶
type ErrWordTooLong struct {
Word string
}
ErrWordTooLong indicates too long word
func NewErrWordTooLong ¶
func NewErrWordTooLong(word string) *ErrWordTooLong
NewErrWordTooLong creates new error
func (*ErrWordTooLong) Error ¶
func (r *ErrWordTooLong) Error() string
type HTTPBackoff ¶ added in v0.2.387
type HTTPBackoff struct { HTTPClient HTTPInvokerJSON InvokeIndicatorFunc func(interface{}) RetryIndicatorFunc func(interface{}) // contains filtered or unexported fields }
HTTPBackoff http call with backoff
func NewHTTPBackoff ¶ added in v0.2.387
func NewHTTPBackoff(realWrapper HTTPInvokerJSON, backoffF func() backoff.BackOff, retryF func(error) bool) (*HTTPBackoff, error)
NewHTTPBackoff creates new wrapper with backoff errF must return same error or wrap to backoff.PermanentError to stop backoff
func (*HTTPBackoff) Info ¶ added in v0.2.407
func (hw *HTTPBackoff) Info() string
Info returns info about wrapper
func (*HTTPBackoff) InvokeJSON ¶ added in v0.2.387
func (hw *HTTPBackoff) InvokeJSON(dataIn interface{}, dataOut interface{}) error
InvokeJSON makes http call with json
func (*HTTPBackoff) InvokeJSONU ¶ added in v0.2.387
func (hw *HTTPBackoff) InvokeJSONU(URL string, dataIn interface{}, dataOut interface{}) error
InvokeJSONU makes call to URL wits JSON
func (*HTTPBackoff) InvokeText ¶ added in v0.2.387
func (hw *HTTPBackoff) InvokeText(dataIn string, dataOut interface{}) error
InvokeText makes http call with text input
type HTTPInvokerJSON ¶ added in v0.2.387
type HTTPInvokerJSON interface { InvokeJSONU(string, interface{}, interface{}) error InvokeJSON(interface{}, interface{}) error InvokeText(string, interface{}) error }
HTTPInvokerJSON http POST invoker with JSON in, out params
type HTTPWrap ¶
type HTTPWrap struct { HTTPClient *http.Client URL string Timeout time.Duration // contains filtered or unexported fields }
HTTPWrap for http call
func NewHTTPWrap ¶ added in v0.2.387
NewHTTPWrap creates new wrapper
func NewHTTPWrapT ¶ added in v0.2.387
NewHTTPWrapT creates new wrapper with timer
func (*HTTPWrap) InvokeJSON ¶
InvokeJSON makes http call with json
func (*HTTPWrap) InvokeJSONU ¶ added in v0.2.387
InvokeJSONU makes http call to URL with JSON
func (*HTTPWrap) InvokeText ¶
InvokeText makes http call with text
type RequestTypeEnum ¶
type RequestTypeEnum int
RequestTypeEnum represent possible request types
const ( //RequestOriginal value RequestOriginal RequestTypeEnum = iota + 1 //RequestNormalized value - text after number replace RequestNormalized //RequestCleaned value - text after clean, normalize and url replace RequestCleaned //RequestUser value - data normalized by user RequestUser //RequestOriginalSSML value RequestOriginalSSML )
func (RequestTypeEnum) String ¶
func (e RequestTypeEnum) String() string