util

package
v0.0.0-...-65f3c3b Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2017 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64

func Base64(s string) string

Base64 converte um string para base64

func Base64Decode

func Base64Decode(s string) string

Base64Decode converte uma string base64 para uma string normal

func BrNow

func BrNow() time.Time

func BuildTLSTransport

func BuildTLSTransport(crtPath string, keyPath string, caPath string) (*http.Transport, error)

BuildTLSTransport creates a TLS Client Transport from crt, ca and key files

func Decrypt

func Decrypt(s string) string

Decrypt decripta string encriptada

func DefaultHTTPClient

func DefaultHTTPClient() *http.Client

DefaultHTTPClient retorna um cliente http configurado para dar um skip na validação do certificado digital

func Duration

func Duration(callback func()) (duration time.Duration)

func Encrypt

func Encrypt(s string) string

Encrypt encripta texto baseado na documentação do GO

func Get

func Get(url, body string, header map[string]string) (string, int, error)

Get faz um requisição GET para uma URL e retorna o response, status e erro

func HeaderToMap

func HeaderToMap(h http.Header) map[string]string

HeaderToMap converte um http Header para um dicionário string -> string

func Mod11

func Mod11(valueSequence string) string

Mod11 calculate Mod11 DV from string

func NycNow

func NycNow() time.Time

func PadLeft

func PadLeft(value, char string, total uint) string

PadLeft insere um caractere a esquerda de um texto

func ParseJSON

func ParseJSON(s string, o interface{}) interface{}

ParseJSON converte string para um objeto GO

func Post

func Post(url, body string, header map[string]string) (string, int, error)

Post faz um requisição POST para uma URL e retorna o response, status e erro

func PostTLS

func PostTLS(url, body string, header map[string]string, transport *http.Transport) (string, int, error)

func RemoveDiacritics

func RemoveDiacritics(s string) string

RemoveDiacritics remove caracteres especiais de uma string

func SeqLogConector

func SeqLogConector(e *flow.ExchangeMessage, u flow.URI, params ...interface{}) error

SeqLogConector é um connector flow para logar no Seq

func Sha256

func Sha256(s string) string

Sha256 converts string to hash sha256 encoded base64

func Stringify

func Stringify(o interface{}) string

Stringify convete objeto para JSON

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

This section is empty.

Jump to

Keyboard shortcuts

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