modulepackage
0.0.0-20250112153432-554128b56bd5
Repository: https://github.com/webtor-io/common-services.git
Documentation: pkg.go.dev
# README
common-services
Collection of commonly used services at webtor.io
Probe
Generates standard liveness and readiness probe endpoints for kubernetes
Serve
Runs simultaneously multiple services in goroutines
Example usage
package main
import (
cs "github.com/webtor-io/common-services"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli"
s "github.com/webtor-io/torrent-http-proxy/services"
)
func configure(app *cli.App) {
app.Flags = []cli.Flag{}
s.RegisterWebFlags(app)
cs.RegisterProbeFlags(app)
app.Action = run
}
func run(c *cli.Context) error {
// Setting ProbeService
probe := cs.NewProbe(c)
defer probe.Close()
// Setting WebService
web := s.NewWeb(c)
defer web.Close()
// Setting ServeService
serve := cs.NewServe(probe, web)
// And SERVE!
err := serve.Serve()
if err != nil {
log.WithError(err).Error("Got serve error")
}
return err
}
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewProbe initializes new Probe instance.
No description provided by the author
NewRedisClient initializes RedisClient.
NewS3Client initializes S3Client.
NewServe initializes Serve.
No description provided by the author
No description provided by the author
RegisterProbeFlags registers cli flags for Probe.
No description provided by the author
RegisterRedisClientFlags registers cli flags for RedisClient.
RegisterS3ClientFlags registers cli flags for S3 client.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
Probe provides simple HTTP-service for Kubernetes liveness and readiness checking.
No description provided by the author
RedisClient makes Redis Client from cli and environment variables Automatically hanldles Sentinel configuration.
S3Client makes AWS SDK S3 Client from cli and environment variables.
Serve serves multible Servables at ones, handles errors and system signals.
# Interfaces
Servable serves something.