GithubHelp home page GithubHelp logo

rss-service's Introduction

Golang RSS service

About the project

The service goal is to parse and return RSS feed as fast as possible. The service implements JWT token authorization.

Prerequisites

Go version go1.19.2 or higher

Development

Download the repo

git clone https://github.com/Alexander96/rss-service

Install dependencies

go mod download

Running it in development mode

go run main.go

Building a Docker image and running it

docker build -t rss-service .
docker run -d -p 808:8080 -t rss-service

Usage

First generate a token. Currently the service supports only admin admin acc

curl -i -u 'admin:admin' --request GET 'localhost:8080/login'

Then make GET API call using the token in a "token" header and body array of RSS URLs

curl --request GET 'localhost:8080/rss' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNjcyNzc0NDc2fQ.y6BPWEvKp3Ow7mEoBh-BYjB4nvYYV7PqGPZsHZbBeXQ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "urls": [
        "http://rss.cnn.com/rss/edition.rss",
        "http://rss.cnn.com/rss/edition_world.rss",
        "http://rss.cnn.com/rss/edition_asia.rss",
        "http://rss.cnn.com/rss/edition_travel.rss",
        "http://rss.cnn.com/rss/cnn_latest.rss"
    ]
}'

Refreshing a token:

curl --request GET 'localhost:8080/refresh' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNjcyODAyMzEwfQ.-MJYaKk5jRr3YDF6GGzK7HW1ykECTfrH-M13CH1FVmw'

rss-service's People

Watchers

James Cloos avatar Alexander Yordanov 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.