App init and graceful watch lib recommendations ?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • appctl

    Application Controller

  • Is there any lib to init the app (read config from yaml, db.. ) and control it's gracefully shutdown? I found this one https://github.com/iv-menshenin/appctl - which doesn't have init thing, but instead has ping service. Was wondering are there any de facto standard libs to do that ?

  • koanf

    Simple, extremely lightweight, extensible, configuration management library for Go. Support for JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper.

  • For configuration, I like Koanf.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • fx

    A dependency injection based application framework for Go. (by uber-go)

  • I’m not sure of much that can do all of that - maybe it’s a use case for https://github.com/uber-go/fx

  • run

    A universal mechanism to manage goroutine lifecycles (by oklog)

  • What I’ve done in the past is use a run group (like https://github.com/oklog/run ) and one of the goroutines in the group is just listening for a SIGINT/SIGTERM/etc. When it sees that it throws an error which cancels the root context and let’s each component handle its own graceful shutdown

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts