Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InitFailedErrorMessage = "server init. failed" MetricsInitFailedErrorMessage = "failed to init. prometheus metrics" )
Error messages used for server and metrics initialization.
Functions ¶
This section is empty.
Types ¶
type Http ¶
type Http interface { Start() IsAlive() bool }
Http interface exposes methods for starting and liveness probing.
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
HttpServer implements Http, wraps all dependencies required for running the HTTP server.
func New ¶
func New( ctx context.Context, cfg *config.Config, cache storage.Storage, seoRepo repository.Seo, reader synced.PooledReader, probe liveness.Prober, ) (*HttpServer, error)
New creates a new HttpServer, initializing metrics and the HTTP server itself. If any step fails, returns an error and performs cleanup.
func (*HttpServer) IsAlive ¶
func (s *HttpServer) IsAlive() bool
IsAlive returns true if the server is marked as alive.
func (*HttpServer) Start ¶
func (s *HttpServer) Start()
Start runs the HTTP server in a goroutine and waits for it to finish.
Click to show internal directories.
Click to hide internal directories.