Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rajnikant7008/cache-service
Cache as a Micro Service
https://github.com/rajnikant7008/cache-service
cache cache-control cache-service cache-storage java java-8 junit junit-test spring spring-boot spring-mvc
Last synced: about 1 month ago
JSON representation
Cache as a Micro Service
- Host: GitHub
- URL: https://github.com/rajnikant7008/cache-service
- Owner: rajnikant7008
- Created: 2018-12-02T07:26:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-03T19:20:58.000Z (about 6 years ago)
- Last Synced: 2024-11-07T15:19:28.746Z (3 months ago)
- Topics: cache, cache-control, cache-service, cache-storage, java, java-8, junit, junit-test, spring, spring-boot, spring-mvc
- Language: HTML
- Homepage: http://cache-service.herokuapp.com/
- Size: 59.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cache Service Rest APIs
**Add to cache**
----
Returns boolean response.* **URL:**
/v1/cache/add* **Method:**
`POST`* **Body**
**Content:** `{ "key" : "country"", "value" : "capital" }`
* **Success Response:*** **Code:** 201
**Content:** `{ true }`
* **Sample Call:**
```
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
"key": "country", \
"value": "capital" \
}' 'https://cache-service.herokuapp.com/v1/cache/add'
```
**Get from cache**
----
Returns element from cache for a given key.
* **URL:**
/v1/cache/get/{key}
* **Method:**
`GET`
* **URL Params**
**Required:**
`key=[string]`
* **Success Response:**
* **Code:** 200
**Content:** `{ "Value" }`
* **Error Response:**
* **Code:** 204 No Content
**Content:** `{ no content }`
* **Sample Call:**
```
curl -X GET --header 'Accept: application/json'
'https://cache-service.herokuapp.com/v1/cache/get/country'
```**Peek from cache**
----
Returns most recently added element from cache.
* **URL:**
/v1/cache/peek
* **Method:**
`GET`
* **URL Params**
**Required:**
None
* **Success Response:**
* **Code:** 200
**Content:** `{ "Value" }`
* **Error Response:**
* **Code:** 204 No Content
**Content:** `{ no content }`
* **Sample Call:**
```
curl -X GET --header 'Accept: application/json'
'https://cache-service.herokuapp.com/v1/cache/peek'
```
**Take from cache**
----
Retrieves and removes the most recently added element from the
cache.
* **URL:**
/v1/cache/take
* **Method:**
`GET`
* **URL Params**
**Required:**
None
* **Success Response:**
* **Code:** 200
**Content:** `{ "Value" }`
* **Error Response:**
* **Code:** 204 No Content
**Content:** `{ no content }`
* **Sample Call:**
```
curl -X GET --header 'Accept: application/json'
'https://cache-service.herokuapp.com/v1/cache/take'
```
**Remove from cache**
----
Returns true if the element was successfully removed.
* **URL:**
/v1/cache/remove/{key}
* **Method:**
`DELETE`
* **URL Params**
**Required:**
`key=[string]`
* **Success Response:**
* **Code:** 200
**Content:** `{ true }`
* **Sample Call:**
```
curl -X DELETE --header 'Accept: application/json'
'https://cache-service.herokuapp.com/v1/cache/remove/country'
```