core

package
v0.0.0-...-16d7efa Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

README

Core Package

Overview

The core package serves as the foundation for setting up and managing server applications in Go.

Key Components

InstallShutdownHandler

InstallShutdownHandler handles system signals and executes shutdown tasks in an orderly manner. This function takes another function as an argument, which is executed when the application receives an interrupt (SIGINT) or terminate (SIGTERM) signal.

Usage:

core.InstallShutdownHandler(func() {
    // Your shutdown logic here
})

By using InstallShutdownHandler, you ensure that all necessary shutdown tasks are taken care of before your service is terminated. Note that the shutdown function provided will run asynchronously in a new goroutine, allowing the main function to continue its operations until a shutdown signal is received.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallShutdownHandler

func InstallShutdownHandler(shutdown func())

InstallShutdownHandler sets up a signal listener and calls the provided shutdown function when an interrupt or terminate signal is received.

Types

type ProfileFetchError

type ProfileFetchError struct {
	Reason string
}

ProfileFetchError represents an error encountered when trying to fetch a profile.

func (ProfileFetchError) Error

func (e ProfileFetchError) Error() string

Error function to represent the ProfileFetchError as a string.

Jump to

Keyboard shortcuts

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