utils

package
v0.0.0-...-abc66c6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxLogDataSize = 100

MaxLogDataSize indicates how many bytes of data to log

Functions

func LogData

func LogData(st string, data string)

LogData logs data to debug

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 ErrWordTooLong

type ErrWordTooLong struct {
	Word string
}

ErrWordTooLong indicates too long word

func NewErrWordTooLong

func NewErrWordTooLong(word string) *ErrWordTooLong

NewErrWordTooLong creates new too long error

func (*ErrWordTooLong) Error

func (r *ErrWordTooLong) Error() string

type HTTPWrap

type HTTPWrap struct {
	HTTPClient *http.Client
	URL        string
	Timeout    time.Duration
}

HTTPWrap for http call

func NewHTTWrap

func NewHTTWrap(urlStr string) (*HTTPWrap, error)

NewHTTWrap creates new wrapper

func (*HTTPWrap) InvokeJSON

func (hw *HTTPWrap) InvokeJSON(dataIn interface{}, dataOut interface{}) error

InvokeJSON makes http call with json

func (*HTTPWrap) InvokeText

func (hw *HTTPWrap) InvokeText(dataIn string, dataOut interface{}) error

InvokeText makes http call with text

Jump to

Keyboard shortcuts

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