utils

package module
v0.0.0-...-ef6bad7 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Log-Http

This is a powerful logger for services.

Installation

Install and start the server.

$ go run main.go
$ go get github.com/gerardoCD/go-utils 

Import in your project


import (
	utils "github.com/gerardoCD/go-utils"
)

Features!

  • Generate SoapRequest with template
  • Generate SoapCall
  • Generate Error Class

Examples!



func main() {
	url := env.URISoap + "/AppClientesBackendServicios/"
	template := templates.RequestSOAP
	httpReq, err := utils.GenerateSOAPRequest(requestSoap,url,template)
	if err != nil {
		lgs.Error("Generando SOAP Request")
		return nil, err
	}
	
	//PETICIÓN A SERVICIO SOAP
	responseSoap, err := utils.SoapCall(httpReq)
	if err != nil {
		lgs.Error("Llamada servicio SOAP")
		return nil, err
	}
}
  

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorLog

func ErrorLog(response *BadResponse, mensaje string, code int, logs string, err error)

Helper response Error and logger

func GenerateSOAPRequest

func GenerateSOAPRequest(Req interface{}, url string, templates string) (*http.Request, error)

Construlle Request SOAP

func SoapCall

func SoapCall(req *http.Request) ([]byte, error)

Realiza llamda SOAP - Despues de construccion del request

Types

type BadResponse

type BadResponse struct {
	ErrorMessage  string      `json:"errorMessage"`
	ErrorDev      string      `json:"errorDev"`
	ErrorResponse interface{} `json:"errorResponse"`
}

Jump to

Keyboard shortcuts

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