Skip to content

A simple go API that returns an image of a calendar from a timestamp and a locale timezone.

License

Notifications You must be signed in to change notification settings

remi-espie/CalenGo

Repository files navigation

📅 CalenGo - A Go Calendar Icon API

What is this ❓

CalenGo is a simple Go program exposing an API which generate on-the-fly an image of a calendar displaying Month and Date (number and weekday).
Add a Unix timestamp and a timezone to get a calendar icon depicting the day of the timestamp in your timezone !

Today's date !

The application is usually available at https://calengo.espie.dev.

The application answer on the url /ping with a beautiful pong and most importantly on /calendar with the arguments timestamp, locale and size to get your image !

On /calendar, you may add timestamp parameter, locale parameter, size parameter, the three of them or none at all !

  • timestamp parameter allows you to send a custom timestamp and get an image for this timestamp.
    Without this parameter, it will use the current timestamp.
  • locale parameter allows you to use a custom timezone for your timestamp. It accepts timezones from IANA Timezone Database's TZ identifier. You can also get them from Wikipedia's tz database list.
    Without this parameter, it will use UTC timezone.
  • size parameter allows you to output an image with a custom size, between 50x50px and 1000x1000px. Lower or higher values will return an image of 1000x1000px.
    Without this parameter, it will output an image of 1000x1000px.

🚀 Getting started

Just run go run main.go from this repository to run the app on port 8080 !

You can also get the latest update from releases, however the only release available was built with and only for Linux x86_64.

You can also build and run a docker image from the project using docker compose up.

You may change your calendar_template.png as well as your font (here Roboto-Bold.ttf) file, but you'll probably need to update the code.

📝 License

This project is under the MIT License - see the LICENSE file for details.

💻 Dependencies for nerds

Developed with Go 19

And the following dependencies:

About

A simple go API that returns an image of a calendar from a timestamp and a locale timezone.

Resources

License

Stars

Watchers

Forks

Packages