Skip to content

A high-performance URL shortener application in Go, featuring robust APIs for URL creation, decoding, and pagination-based listing.

License

Notifications You must be signed in to change notification settings

cosmicray001/go-url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-url-shortener


Software Architecture

image


API list

1. /api/ping

Request Method: GET

Response:

{
    "status": "up and running"
}

2. /api/shorten

Request Method: POST

Request Body:

{
  "url": "https://www.youtube.com/watch?v=TLB5MY9BBa4&ab_channel=CoderDave"
}

Response:

{
    "results": {
        "id": 13,
        "actual_url": "https://www.youtube.com/watch?v=TLB5MY9BBa4&ab_channel=CoderDave",
        "short_url": "77cf66ac",
        "total_hit": 0,
        "created_at": "2023-07-23T14:37:53.241159Z"
    }
}

3. /api/decode/{shortUrl}

Request Method: GET Response:

{
    "results": {
        "id": 13,
        "actual_url": "https://www.youtube.com/watch?v=TLB5MY9BBa4&ab_channel=CoderDave",
        "short_url": "77cf66ac",
        "total_hit": 6,
        "created_at": "2023-07-23T14:37:53.241159Z"
    }
}

4. /api/urls?limit=10&offset=10

Request Method: GET Query Parameter:

limit = <<number>> // 10
offset = <<number>> // 1

Response:

{
    "count": 15,
    "results": [
        {
            "id": 14,
            "actual_url": "https://www.example.com/",
            "short_url": "8797b6c7",
            "total_hit": 0,
            "created_at": "2023-07-23T17:16:09.239242Z"
        }
    ]
}

About

A high-performance URL shortener application in Go, featuring robust APIs for URL creation, decoding, and pagination-based listing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages