kit

module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2025 License: MIT

README

kit

Graceful

import (
	"github.com/litsea/kit/graceful"
)

g := graceful.New(
	graceful.WithService(srv),
	graceful.WithLogger(l),
	graceful.WithStopTimeout(time.Second*5),
)

err := g.Run(context.Background())
if err != nil {
	l.Error("service.gracefulRun", "error", err)
}

See: graceful.go

pprof

import (
	"net/http"

	"github.com/litsea/kit/pprof"
)

mux := http.NewServeMux()

pprof.Register(mux, func() string {
	return "token"
})

Health Check

import (
	"net/http"

	"github.com/litsea/kit/health"
)

mux := http.NewServeMux()

health.Register(mux, "/v1/health")

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL