service

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 10 Imported by: 8

Documentation

Overview

Package service allows to manage a service leveraging helix.go, as well as managing integrations' lifecycle attached to the service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attach

func Attach(inte integration.Integration) error

Attach allows to attach a third-party integration to a service. When attached, the Init and Close methods of the integration are automatically called when the service is initializing and stopping, so they shouldn't be called manually by the clients.

func Close

func Close(ctx context.Context) error

Close tries to gracefully close connections with all integrations. It then tries to drain/close the tracer and logger.

func Start

func Start(ctx context.Context) error

Start initializes the helix service, and starts each integration attached by executing their Start function. This returns as soon as an interrupting signal is catched or when an integration returns an error while starting it.

func Status

func Status(ctx context.Context) (int, error)

Status executes a health check of each integration attached to the service, and returns the highest HTTP status code returned. This means if all integrations are healthy (status `200`) but one is temporarily unavailable (status `503`), the status returned would be `503`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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