correios

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

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 5 Imported by: 0

README

goRREIOS

An implementation to API Correios builded using GoLang
// Example:
// Get events of 'AA598971235BR'
package main

import (
	"fmt"

	correios "github.com/MarceloMPJ/goRREIOS"
)

func main() {
	events, err := correios.BuscaEventos("AA598971235BR")

	if err != nil {
		fmt.Println(err)
		return
	}

	if len(events) > 0 {
		fmt.Println(*events[0])
		/*
		{
			Tipo:      "PO",
			Status:    1,
			Data:      "04/02/2022",
			Hora:      "13:03",
			Descricao: "Objeto postado",
			Local:     "Agência dos Correios",
			Codigo:    0,
			Cidade:    "SAO PAULO",
			UF:        "SP",
		}
		*/
	}
}

Documentation

Index

Constants

View Source
const InvalidStatusCode string = "invalid status code: %d"

Variables

This section is empty.

Functions

func BuscaEventos

func BuscaEventos(code string) ([]*response.Event, error)

BuscaEventos is a function that receive one tracking code and return events for this code

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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