Skip to content

This is the sample go repository explains the stateless behavior. It has Rest endpoints which encrypts the text based on given key.

Notifications You must be signed in to change notification settings

bhaumikshukla/go-stateless-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-stateless-demo

This is the sample webservice written in golang using Fiber. This explains the stateless behavior. It has REST endpoints which encrypts the text based on given key. This webservice won't store any data.

Build

cd go-stateless-demo/
go build

Run the application

./fibr

This will run the application on port 8000

Endpoints

Encrypt the text

POST - /encrypt

{
    "key":"thisis32bitlongpassphraseimusing", "text": "Hello"
}

Sample Response:

{
    "enc": "DvXHa9E_CKtad5YOJUMsn0iyZvkN"
}

Decrypt using Key

POST - /decrypt

{
    "key":"thisis32bitlongpassphraseimusing", "enc": "DvXHa9E_CKtad5YOJUMsn0iyZvkN"
}

Sample response

{
    "text": "Hello"
}

About

This is the sample go repository explains the stateless behavior. It has Rest endpoints which encrypts the text based on given key.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published