Lol-champions-api - A REST API app for CRUD' ing informations related to League of Legends champions, written with Go

LOL-CHAMPIONS-API

Just a REST API app for CRUD' ing informations related to League of Legends champions, written with Go. Demonstration video at Youtube can be found here

It will be updated for GraphQL and gRPC versions.

Installation

Before using, you must have Go and Docker. Of course there will be no data in database but don't worry, you can fetch latest hero informations from LOL server with this repo

go get -u github.com/fukaraca/lol-champions-api

Dockerized MongoDB containers can be initialized from app folder with commands depending container status:

docker compose up or docker compose start

Since our containers are running:

go run main.go

Ready to go...

Quick Start

You can Bash it or use POSTMAN. (Portal column at the table points to related POSTMAN tab eg params, headers, body, raw, json etc)

To retrieve hero list

If you want to check hero list:

Method URL Portal
GET http://localhost:8080/rest/champions/list NA

Query Hero and Informations

You can query by two options. Sample query URL's given in the table:

  • Either query a hero with its name and take results of desired fields.For brevity, comma is used for seperation so repetition of q=vals is not needed.
  • Or make a conditional query by key, operand and value.
Method URL Portal
GET http://localhost:8080/rest/champions?name=Jinx&q=lore,stats.hp,spells.name Params
GET http://localhost:8080/rest/champions?key=stats.mp&op=gt&val=250 Params
  • First query URL returns Lore,Health Pointand Spells for hero named Jinx
  • Second query URL returns hero names who has gt(greater than) 250 Mana point

Field's can be found at lib/model.go as json tagged. It is same as default LOL JSON return. Operands for second query is same for MongoDB but with no $ sign. For example; eq, gt, lt...

Create New Champion

You can use both raw JSON and Form-Data tab but for detailed creation JSON way must be picked.

Method URL Portal
POST http://localhost:8080/rest/champions Body/form-data
POST http://localhost:8080/rest/champions/createWJSON Body/raw - JSON

Update Hero Informations

You can revoke, boost or nerf you favorite champion or change any field you want to. Total of 4 Body/form-data inputs are required. These are name indicates hero name to be changed,key is for field that will be modified,op is operand obviously and val is new value .

Method URL Portal
PATCH http://localhost:8080/rest/champions Body/form-data

Delete Champion

You can also delete any champion you want.

Method URL Portal
DELETE http://localhost:8080/rest/champions Body/form-data
Owner
Furkan KARACA
life-long-learner Go
Furkan KARACA
Similar Resources

Unofficial Go SDK for GoPay Payments REST API

Unofficial Go SDK for GoPay Payments REST API Installation go get https://github.com/apparently-studio/gopay-go-api Basic usage client := gopay.NewCl

Nov 18, 2022

Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs

Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs

PnPjs is a fluent JavaScript API for consuming SharePoint and Microsoft Graph REST APIs in a type-safe way. You can use it with SharePoint Framework,

Dec 23, 2022

Use Google REST api to extract your personal Photo Library

Photo Go A better approach to extracting your photos from Google to your personal cloud. I'm moving my photos out of Google to a Synology NAS. create

Dec 7, 2021

A REST API microservices-based Twitter Clone server.

Simple API Twitter Clone A REST API microservices-based project to fetch, edit, post, and delete tweets. API documentation The API documentation is bu

May 13, 2022

Go REST API for movies

Greenlight API Greenlight is an api, i implemented by following the book Let's Go Further by Alex Edwards If you like what you see please consider buy

Jul 17, 2022

Hassle-free REST API testing for Go

melatonin melatonin is a fluent, flexible REST API testing library for Go. It provides many of the benefits of a domain-specific test language but wit

Jan 8, 2022

A rest-api that works with golang as coin portfolio

Koinfolio A rest-api that works with golang as coin portfolio Technical Details Golang/Gin is used as application framework MongoDB is database Usage

Jun 1, 2022

REST API for "MovieShare".

movieshare_api Repository for backend of project "MovieShare". MovieShare API An awesome API for project "MovieShare". Requirements See modules list i

Apr 14, 2022

Stq - Simple Task Queue with REST API

stq Simple Tasks Queue with HTTP API Environments list: Variable Value BACKEND m

Jan 5, 2022
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.

tutor-pet API Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure. Macro architecture: Code architecture: Pre-Re

Aug 17, 2022
OpenAPI specification and related artifacts for HashiCorp Nomad

Overview This repository contains the HashiCorp Nomad OpenAPI specification and related artifacts. The OpenAPI specification defines a machine-readabl

Dec 14, 2022
Service that wrap up different movies-related APIs like IMDB and match it to streaming services
Service that wrap up different movies-related APIs like IMDB and match it to streaming services

Service that wrap up different movies-related APIs like IMDB and match it to streaming services. That way you can check in which platforms you can find your favorite movies.

Feb 10, 2022
A GitHub CLI extension that displays collaboration-related information about a GitHub repository.
A GitHub CLI extension that displays collaboration-related information about a GitHub repository.

collab-scanner GitHub CLI extension A GitHub CLI extension that displays collaboration-related information on a repository. Install gh extension insta

Dec 30, 2022
A Go client library enabling programs to perform CRUD operations on the goharbor API.

goharbor-client A Go client library enabling programs to perform CRUD operations on the goharbor API. This client library utilizes types generated by

Jan 10, 2022
Rest API to get KVB departures - Written in Go with hexagonal architecture and tracing via OpenTelemetry and Jaeger

KVB API Rest API to get upcoming departures per KVB train station Implemented in Go with hexagonal architecture and tracing via OpenTelemetry and Jaeg

May 7, 2022
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Feb 6, 2022
go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface

go-whatsapp-rest-API go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface Multi-devices (MD) Support. This ver

Dec 15, 2022
Go Twitter REST and Streaming API v1.1

go-twitter go-twitter is a Go client library for the Twitter API. Check the usage section or try the examples to see how to access the Twitter API. Fe

Dec 28, 2022
Golang client for PayPal REST API

Go client for PayPal REST API Coverage POST /v1/oauth2/token POST /v1/identity/openidconnect/tokenservice GET /v1/identity/openidconnect/userinfo/?sch

Dec 25, 2022