Skip to content

ds4tech/finesse-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple calculator application written in Go lang.

  1. Introduction
  2. Build
    2.1. Exec
    2.2. Docker
  3. Deploy
    3.1. Kubernetes
  4. Usage
  5. Continous Integration

Introduction

Simple Go Calculator project with some math function:

  • Sum
  • Sqrt
  • Factorial
  • IsPrime
  • Log

BUILD

Executable

go build -o main cmd/calculator/main.go
./main

http://localhost:8888/

Docker container

docker build -t go-calc -f build/package/Dockerfile .
docker run -d -p 80:8888 go-calc

http://localhost/

DEPLOY

Kubernetes

kubectl create -f deployments/kubernetes/k8s-replicaSet.yml

http://192.168.99.100:30000/

USEAGE

  1. SUM
curl --location --request POST "http://localhost:8888/v1/sum" \
--header "Content-Type: application/json" \
--data "{\"num1\":\"2\", \"num2\":\"4\"}"
  1. SQRT
curl --location --request POST "http://localhost:8888/v1/sqrt" \
--header "Content-Type: application/json" \
--data "{\"number\":\"144\"}"
  1. FACTORIAL
curl --location --request POST "http://localhost:8888/v1/factorial" \
--header "Content-Type: application/json" \
--data "{\"number\":\"6\"}"
  1. ISPRIME
curl --location --request POST "http://localhost:8888/v1/isPrime" \
--header "Content-Type: application/json" \
--data "{\"number\":\"6\"}"
  1. LOG
curl --location --request POST "http://localhost:8888/v1/log" \
--header "Content-Type: application/json" \
--data "{\"number\":\"6\"}"

About

assignment for interview

Resources

License

Stars

Watchers

Forks

Packages

No packages published