Skip to content

A high-performance solution built in Go, designed to fetch cryptocurrency values concurrently from various REST APIs

License

Notifications You must be signed in to change notification settings

gustavobrossi/bitcoin-price

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bitcoin-price

Overview

Bitcoin-Price is a high-performance solution built in Go, designed to fetch cryptocurrency values concurrently from various REST APIs. It's engineered for efficiency and speed, utilizing Go's robust concurrency model to make multiple endpoint calls simultaneously. This project stands out for its minimalistic approach, resulting in an extremely small Docker image based on scratch, making it lightweight and fast.

Features

  • Concurrent API Calls: Leverages Go's concurrency for efficient API querying.
  • Flexible Configuration: Easily configurable for fetching values of various assets, not limited to Bitcoin.
  • Minimal Docker Image: Built on scratch, ensuring a small footprint.
  • Robust Error Handling: Handles API rate limits and networking issues with a retry mechanism.

Usage

Local Setup

go build -o main .
./main

Docker Setup

Build the Docker image:

docker build -t bitcoin-price .

Run the Docker container (ensure config.json is in your current directory):

docker run -w $(pwd) -v $(pwd):$(pwd) bitcoin-price

Configuration

config.json allows adding new exchanges or assets easily. Example:

[
    {
        "exchange": "NewExchange",
        "url": "https://api.newexchange.com/price",
        "jsonPath": "price"
    }
    // ... other configurations ...
]

Contribution

Contributions are welcome! Feel free to submit pull requests or open issues for enhancements, bug fixes, or suggestions.

About

A high-performance solution built in Go, designed to fetch cryptocurrency values concurrently from various REST APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published