Socket
Book a DemoInstallSign in
Socket

github.com/victormilk/fullcycle-multithreading

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/victormilk/fullcycle-multithreading

v0.0.0-20240917213927-7f7bb805c930
Source
Go
Version published
Created
Source

CEP Lookup Service

This project is a simple Go application that fetches address information based on a given CEP (Brazilian postal code) using two different APIs: BrasilAPI and ViaCepAPI. The application runs both API requests concurrently and returns the result from the API that responds first.

Prerequisites

  • Go
  • Make

Installation

  • Clone the repository:

    git clone https://github.com/victormilk/fullcycle-multithreading.git
    cd fullcycle-multithreading
    
  • Install dependencies:

    go mod tidy
    

Usage

To run the application, you can use the provided Makefile. By default, it uses the CEP 01153000.

  • Run the application:

    make run
    
  • To specify a different CEP:

    make run CEP=12345678
    
  • Using go cli

    go run main.go
    
  • To specify a different CEP using go cli:

    go run main.go 12345678
    

Endpoints

  • BrasilAPI: https://brasilapi.com.br/api/cep/v1/{cep}
  • ViaCepAPI: https://viacep.com.br/ws/{cep}/json

FAQs

Package last updated on 17 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.