Documentation ¶
Index ¶
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 bytes 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
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 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) 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 RequestNormalized //RequestCleaned value RequestCleaned //RequestUser value - data normalized by user RequestUser //RequestOriginalSSML value RequestOriginalSSML )
func (RequestTypeEnum) String ¶
func (e RequestTypeEnum) String() string