Giter Site home page Giter Site logo

fc-goexpert-challenge-02's Introduction

Go Expert

Desafio Multithreading

Para executar o programa, através do terminal acesse o diretório raiz deste projeto e execute o comando a seguir:

go run cmd/cep/main.go {CEP}

O termo {CEP} deve ser substituído pelo CEP que será pesquisado. Exemplo:

go run cmd/cep/main.go 89023-600

Se a consulta for bem sucedida, os dados da resposta serão exibidas no terminal no seguinte formato:

{
  "Provider": "provider",
  "Response": "object"
}

O campo Provider exibirá o nome do provedor que entregou a resposta primeiro. Os possíveis valores são:

  • Via CEP
  • Api CEP

O campo Response exibirá os dados da resposta do provedor. Quando o provedor for "Via CEP", o campo Response terá o seguinte formato:

{
    "cep": "string",
    "logradouro": "string",
    "complemento": "string",
    "bairro": "string",
    "localidade": "string",
    "uf": "string",
    "ibge": "string",
    "gia": "string",
    "ddd": "string",
    "siafi": "string"
}

No caso de uma resposta do provedor "Api CEP", o campo Response será composto pela seguinte estrutura:

{
    "code": "string",
    "state": "string",
    "city": "string",
    "district": "string",
    "address": "string",
    "status": "number",
    "ok": "boolean",
    "statusText": "string"
}

Em caso de timeout, será exibida a mensagem "timeout" no terminal.

fc-goexpert-challenge-02's People

Contributors

josimarz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.