healing

Форк
0

README.md

Healing Go Reference

Healing is package contains a liveness and readiness controllers, compatible with squad package. Also contains postgresql and mysql pools with readiness checker.

Usage

package main
import (
"context"
"time"
"github.com/moeryomenko/healing"
"github.com/moeryomenko/healing/checkers"
"github.com/moeryomenko/squad"
)
func main() {
ctx := context.Background()
// create health/readiness controller.
h := healing.New(8081 // health controller port.
healing.WithCheckPeriod(3 * time.Second),
healing.WithReadinessTimeout(time.Second),
healing.WithReadyEndpoint("/readz"),
)
// add pool readiness controller to readiness group.
h.AddReadyChecker("pgx", checkers.PgxReadinessProber(pool))
// create squad group runner.
s := squad.NewSquad(squad.WithSiganlHandler())
// run health/readiness controller in squad group.
s.RunGracefully(h.Heartbeat, h.Stop)
...
s.Wait()
}

License

Healing is primarily distributed under the terms of both the MIT license and Apache License (Version 2.0).

See LICENSE-APACHE and/or LICENSE-MIT for details.

Описание

Сompatible with squad health/readiness controller

Языки

Go

Сообщить о нарушении

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.