Documentation ¶
Index ¶
- func BarcodeDv(valueSequence string) string
- func Base64(s string) string
- func Base64Decode(s string) string
- func BrNow() time.Time
- func BuildTLSTransport(con certificate.TLSCertificate) (*http.Transport, error)
- func CheckErrorRobot(err error) bool
- func Decrypt(s string) string
- func DefaultHTTPClient() *http.Client
- func Duration(callback func()) (duration time.Duration)
- func Encrypt(s string) string
- func FromJSON(jsonStr string, obj interface{}) error
- func GetDurationTimeoutRequest(t string) time.Duration
- func GetFont() font
- func GetTLSVersion(version string) uint16
- func HeaderToMap(header http.Header) map[string]string
- func IsBasicCharacter(r rune) bool
- func IsCaixaSpecialCharacter(r rune) bool
- func IsDigit(r rune) bool
- func LogConector(e *flow.ExchangeMessage, u flow.URI, params ...interface{}) error
- func MinifyString(mString, tp string) string
- func NycNow() time.Time
- func OurNumberDv(valueSequence string, modFunc ModFunc, base ...int) string
- func PadLeft(value, char string, total uint) string
- func ParseJSON(s string, o interface{}) interface{}
- func Post(url, body, timeout string, header map[string]string) (string, int, error)
- func PostReponseWithHeader(url, body, timeout string, header map[string]string) (string, string, int, error)
- func PostTLS(url, body, timeout string, header map[string]string, transport *http.Transport) (string, int, error)
- func PostTLSWithHeader(url, body, timeout string, header map[string]string, transport *http.Transport) (string, map[string]interface{}, int, error)
- func PostWithHeader(url, body, timeout string, header map[string]string) (string, map[string]interface{}, int, error)
- func SanitizeBody(body string) string
- func Sha256(s, e string) string
- func SignRequest(request string) (string, error)
- func Stringify(o interface{}) string
- func TimeToLocalTime(t time.Time) time.Time
- func TlsConector(e *flow.ExchangeMessage, u flow.URI, params ...interface{}) error
- func ToJSON(obj interface{}) string
- type HTTPClient
- type HTTPInterface
- type Mask
- type ModFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
Base64Decode converte uma string base64 para uma string normal
func BuildTLSTransport ¶
func BuildTLSTransport(con certificate.TLSCertificate) (*http.Transport, error)
BuildTLSTransport creates a TLS Client Transport from crt, ca and key files
func CheckErrorRobot ¶
func DefaultHTTPClient ¶
DefaultHTTPClient retorna um cliente http configurado para dar um skip na validação do certificado digital
func GetTLSVersion ¶
func HeaderToMap ¶
HeaderToMap converte um http Header para um dicionário string -> string
func IsBasicCharacter ¶
IsBasicCharacter Verifica se um caracter é uma letra sem acento, maiúscula ou minúscula, de acordo com o código decimal da Tabela ASCII onde o 'A' representa o valor 65 e o 'Z' o valor 90 e o 'a' representa o valor 97 e 'z' o valor 122 true para 0123456789
func IsCaixaSpecialCharacter ¶
IsCaixaSpecialCharacter Verifica se um caracter especial é aceito Caixa Econômica, de acordo com o código decimal da Tabela ASCII sendo aceito os seguinte caracteres:
esp 32 ' 39 : 58 ! 33 ( 40 ; 59 ) 41 = 61 * 42 + 43 ? 63 , 44 - 45 _ 95 . 46 / 47
OBS: Apesar de descritos como aceitos, os caracteres & (38) < (60) e > (62) foram removidos pois não estão disponíveis para XML. Testamos seus respectivos encodes: & < > entretanto recebemos a resposta (66) CARACTER INVALIDO.
func IsDigit ¶
IsDigit Verifica se um caracter é um dígito numérico de acordo com o código decimal da Tabela ASCII, onde o '0' representa o valor 48 e o '9' o valor 57
func LogConector ¶
func LogConector(e *flow.ExchangeMessage, u flow.URI, params ...interface{}) error
LogConector é um connector flow para utilizar as rotinas de log
func MinifyString ¶
MinifyString Minifica uma string de acordo com um determinado formato
func OurNumberDv ¶
OurNumberDv calculate DV from OurNumber
func ParseJSON ¶
func ParseJSON(s string, o interface{}) interface{}
ParseJSON converte string para um objeto GO
func PostReponseWithHeader ¶
func PostReponseWithHeader(url, body, timeout string, header map[string]string) (string, string, int, error)
Post faz um requisição POST para uma URL e retorna o response, status e erro
func PostTLSWithHeader ¶
func PostWithHeader ¶
func PostWithHeader(url, body, timeout string, header map[string]string) (string, map[string]interface{}, int, error)
PostWithHeader faz um requisição POST para uma URL e retorna o response, status e erro
func TlsConector ¶
func TlsConector(e *flow.ExchangeMessage, u flow.URI, params ...interface{}) error
TlsConector is a connector to send https request client certificate Params[0] *http.Transport (http.Transport configuration with certificate files config)
Types ¶
type HTTPClient ¶
type HTTPClient struct{}
HTTPClient is the struct for making requests
func (*HTTPClient) PostFormURLEncoded ¶
func (hc *HTTPClient) PostFormURLEncoded(endpoint string, params map[string]string, log *log.Log) ([]byte, error)
PostFormEncoded is a function for making requests using Post Http method with content-type application/x-www-form-urlencoded.
It receives an endpoint, params and pointer for log and it creates a new Post request, returning []byte and a error.
type HTTPInterface ¶
type HTTPInterface interface {
Post(url string, headers map[string]string, body interface{}) (*http.Response, error)
}
HTTPInterface is an abstraction for HTTP client
type Mask ¶
type Mask struct {
// contains filtered or unexported fields
}