starter

package
v0.0.0-...-31b4c3b Latest Latest
Warning

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

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

Documentation

Overview

Package starter used for starting and shuting down application components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fn

type Fn func(ctx context.Context) error

Fn type for functions can be injected into starter.

type Starter

type Starter struct {
	// contains filtered or unexported fields
}

Starter struct for starting components.

func New

func New(ctx context.Context) *Starter

New creates a new starter.

func (*Starter) Cancel

func (s *Starter) Cancel(err error)

Cancel canceles execution.

func (*Starter) OnRun

func (s *Starter) OnRun(fns ...Fn) *Starter

OnRun mark function for run on run.

func (*Starter) OnShutdown

func (s *Starter) OnShutdown(fns ...Fn) *Starter

OnShutdown mark function for run on termination.

func (*Starter) Run

func (s *Starter) Run() error

Run runs all functions.

Jump to

Keyboard shortcuts

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