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

Overview

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
You might also like...
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

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,

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

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

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

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

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

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

Stq - Simple Task Queue with REST API

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

Owner
Furkan KARACA
life-long-learner Go
Furkan KARACA
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

Lucas Ferreira 3 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

HashiCorp 42 Sep 21, 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. That way you can check in which platforms you can find your favorite movies.

Xavier Graterol 2 Feb 10, 2022
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

Nicolas Kosinski 4 Jun 2, 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

null 0 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

Jan Ritter 3 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

Siva Prakash 3 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

null 16 May 13, 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

Dalton Hubble 1.5k Sep 24, 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

Alex Pliutau 524 Sep 27, 2022