All Projects → thecasualcoder → dobby

thecasualcoder / dobby

Licence: Apache-2.0 license
dobby is free and will serve your orders

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
Open Policy Agent
39 projects

Projects that are alternatives of or similar to dobby

doctools
doctools for eggjs
Stars: ✭ 38 (+58.33%)
Mutual labels:  docs
huddle-apis
Documentation for the Huddle API
Stars: ✭ 17 (-29.17%)
Mutual labels:  docs
ripgrep-zh
中文翻译:<BurntSushi/ripgrep> 一个面向行的搜索工具 ❤️ 校对 ✅
Stars: ✭ 82 (+241.67%)
Mutual labels:  docs
sphinx rtd dark mode
Adds a toggleable dark mode to the Read the Docs theme for Sphinx.
Stars: ✭ 29 (+20.83%)
Mutual labels:  docs
docs
Project Z, an initiative to build a Haskell engineering eco-system.
Stars: ✭ 26 (+8.33%)
Mutual labels:  docs
blurz
Blurz - Bluetooth lib for Rust using blueZ/dbus
Stars: ✭ 67 (+179.17%)
Mutual labels:  hactoberfest
GMCPAdditions
These are additions to the IRE gmcp documentation
Stars: ✭ 21 (-12.5%)
Mutual labels:  docs
braze-docs
The Braze Documentation site repository.
Stars: ✭ 40 (+66.67%)
Mutual labels:  docs
SportsPage
运动页,一个基于社交的体育类APP
Stars: ✭ 30 (+25%)
Mutual labels:  docs
instapy-docs
📜 Public information for users, testers, contributors, maintainers
Stars: ✭ 60 (+150%)
Mutual labels:  docs
iDocs
iDocs is one page documentation html template which helps you to create your offline and online documentation for your themes, templates, plugins and software.
Stars: ✭ 75 (+212.5%)
Mutual labels:  docs
fliegdoc
A documentation generator for Typescript-based libraries with good support for monorepos
Stars: ✭ 24 (+0%)
Mutual labels:  docs
metadoc.js
Generates JSON metadata for Object Oriented JavaScript libraries. Used as a source for generating documentation.
Stars: ✭ 20 (-16.67%)
Mutual labels:  docs
api-doc
自动化文档生成工具
Stars: ✭ 13 (-45.83%)
Mutual labels:  docs
mvp-docs
The Unofficial MVP Contribution Guide:
Stars: ✭ 18 (-25%)
Mutual labels:  docs
mongoose-to-swagger
Conversion library for transforming Mongoose schema objects into Swagger schema definitions.
Stars: ✭ 50 (+108.33%)
Mutual labels:  docs
docs
Altinn documentation.
Stars: ✭ 17 (-29.17%)
Mutual labels:  docs
manual
li₃: The Definitive Guide
Stars: ✭ 64 (+166.67%)
Mutual labels:  docs
now-docs
[WIP] Deploy docs with a single command using Now
Stars: ✭ 45 (+87.5%)
Mutual labels:  docs
readonlyrest-docs
Official Documentation of ReadonlyREST Plugin
Stars: ✭ 77 (+220.83%)
Mutual labels:  docs

dobby

Build Status Go Doc Go Report Card

Dobby GIF

About

dobby is free and will serve your orders.

You can start dobby in Docker using:

$ docker run -p 4444:4444 thecasualcoder/dobby

which will start dobby server in port 4444.

Features

You can ask dobby any of the following

Version

$ curl localhost:4444/version

Metadata

$ curl localhost:4444/meta

Health

Ask dobby

About its health

$ curl -i localhost:4444/health
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:32:02 GMT
Content-Length: 16
  
{"healthy":true}

To be healthy

$ curl -i -X PUT localhost:4444/control/health/perfect
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:33:02 GMT
Content-Length: 20

{"status":"success"}

$ curl -i localhost:4444/health
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:33:16 GMT
Content-Length: 16

{"healthy":true}

To fall sick

$ curl -i -X PUT localhost:4444/control/health/sick
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:33:29 GMT
Content-Length: 20

{"status":"success"}

$ curl -i localhost:4444/health
HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:33:48 GMT
Content-Length: 17

{"healthy":false}

To recover health after sometime

$ curl -i -X PUT "localhost:4444/control/health/sick?resetInSeconds=20"
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:34:42 GMT
Content-Length: 20

{"status":"success"}

$ curl -i localhost:4444/health
HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:34:47 GMT
Content-Length: 17

{"healthy":false}

#  After 20seconds
$ curl -i localhost:4444/health
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:35:12 GMT
Content-Length: 16

{"healthy":true}  

Readiness

Ask dobby

About its readiness

$ curl -i localhost:4444/readiness
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:40:30 GMT
Content-Length: 14

{"ready":true}

To be ready

$ curl -i -X PUT localhost:4444/control/ready/perfect
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:40:51 GMT
Content-Length: 20

{"status":"success"}

$ curl -i localhost:4444/readiness
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:41:25 GMT
Content-Length: 14

{"ready":true}

To be unready

$ curl -i -X PUT localhost:4444/control/ready/sick
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:41:41 GMT
Content-Length: 20

{"status":"success"}

$ curl -i localhost:4444/readiness
HTTP/1.1 503 Service Unavailable
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:41:58 GMT
Content-Length: 15

{"ready":false}

To recover readiness after sometime

$ curl -i -X PUT "localhost:4444/control/ready/sick?resetInSeconds=20"
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:42:39 GMT
Content-Length: 20

{"status":"success"}

$ curl -i localhost:4444/readiness
HTTP/1.1 503 Service Unavailable
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:42:43 GMT
Content-Length: 15

{"ready":false}

#  After 20seconds
$ curl -i localhost:4444/readiness
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:43:05 GMT
Content-Length: 14

{"ready":true}

Disruptions

You can also ask dobby to

Add load on memory

# to create a memory spike
$ curl -i -X PUT localhost:4444/control/goturbo/memory
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 12:00:22 GMT
Content-Length: 20

{"status":"success"}

Add load on CPU

# to create a cpu spike
$ curl -i -X PUT localhost:4444/control/goturbo/cpu
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 12:01:07 GMT
Content-Length: 20

{"status":"success"}

Kill itself

$ curl -i -X PUT localhost:4444/control/crash
# Beware, this is stop the running server

Repeat Http Code

Ask dobby

To return a given status code

$ curl -i localhost:4444/return/200
HTTP/1.1 200 OK
Date: Sun, 17 May 2020 09:51:13 GMT
Content-Length: 0

To return a given status code (with requested delay in milliseconds)

$ curl -i localhost:4444/return/401?delay=300
HTTP/1.1 401 Unauthorized
Date: Sun, 17 May 2020 09:50:34 GMT
Content-Length: 0

Call a service

To call another service

# To make a get request to http://httpbin.org/get
$ curl -i localhost:4444/call -d '{"url": "http://httpbin.org/get", "method": "GET"}'
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:46:25 GMT
Content-Length: 240

{"args":{},"headers":{},"url":"http://httpbin.org/get"}

# To make a post request to http://httpbin.org/post
$ curl -i localhost:4444/call -d '{"url": "http://httpbin.org/post", "method": "POST", "body": "{key: value}"}'
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:49:09 GMT
Content-Length: 311

{"args":{},"data":"\"{key: value}\"","files":{},"form":{},"headers":{},"json":"{key: value}","url":"http://httpbin.org/post"}

Configure Proxies

To proxy a call

$ curl -i localhost:4444/proxy -d '{"path":"/time","method": "GET", "proxy": {"url":"http://worldtimeapi.org/api/timezone/asia/kolkata","method":"GET"}}'
HTTP/1.1 201 Created
Date: Tue, 16 Mar 2021 11:51:32 GMT
Content-Length: 0

$ curl -i localhost:4444/time
# makes a call to http://worldtimeapi.org/api/timezone/asia/kolkata

To delete a configured proxy

$ curl -i -X DELETE localhost:4444/proxy -d '{"path":"/time","method": "GET", "proxy": {"url":"http://worldtimeapi.org/api/timezone/asia/kolkata","method":"GET"}}'
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Mar 2021 11:55:22 GMT
Content-Length: 50

{"result":"deleted the proxy config successfully"}

$ curl -i localhost:4444/time
HTTP/1.1 404 Not Found
Content-Type: text/plain
Date: Tue, 16 Mar 2021 11:55:46 GMT
Content-Length: 18

404 page not found

Run

Configurations

Available configurations:

Key Value Purpose Default
VERSION String To set the version of program Build Arg
INITIAL_DELAY Int Sets the initial delay to start the server (in seconds) 0
INITIAL_HEALTH String Sets the initial health of the program TRUE
INITIAL_READINESS String Sets the initial readiness of the program TRUE
PORT Int Sets the port of the server 4444
BIND_ADDR String Listen address of the process 127.0.0.1

Run in local

$ git clone https://github.com/thecasualcoder/dobby.git && cd dobby
$ make compile
$ ./out/dobby server

Swagger Docs

Swagger docs will be available at: http://localhost:4444/swagger/index.html

Contributing

Fork the repo and start contributing

Guidelines

  • Make sure to run build before raising PR (make build)
  • Make sure to generate and check in swagger docs if any added (make swagger-docs)
  • Update README.md if necessary
  • Check goreleaser before pushing (goreleaser --snapshot --skip-publish --rm-dist --debug)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].