util

package
v0.0.0-...-8a5cdbf Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildURL

func BuildURL(host, path string) string

BuildURL - URL builder.

func Canonical

func Canonical(method, contentType, content, urlPath string, now time.Time) string

Canonical - Builds the canonical string required for the signature.

func ContentMD5

func ContentMD5(content string) string

ContentMD5 - Generate the MD5 of the Body string.

func ExtractBody

func ExtractBody(response *http.Response) ([]byte, error)

ExtractBody - Encapsulation of the task which extracts body response data.

func HTTPDate

func HTTPDate(date time.Time) string

HTTPDate - Generate the Date in HTTP format for UTC/GMT time.

func PostRequest

func PostRequest(url string, headers map[string]string, body []byte) (*http.Response, error)

PostRequest - HTTP POST Request using Golang stdlib. url - String URL. headers - Headers to be included in the request. body - Request body.

func ValidateCurp

func ValidateCurp(curp string) bool

ValidateCurp - CURP validation.

func ValidateEmail

func ValidateEmail(email string) bool

ValidateEmail - Email validation.

func ValidateFullData

func ValidateFullData(fullData interface{}) error

ValidateFullData - Validation of extra lead data.

Types

type PostRequestFunc

type PostRequestFunc func(url string, headers map[string]string, body []byte) (*http.Response, error)

PostRequestFunc - Interface for web requests.

Jump to

Keyboard shortcuts

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