launcher

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package launcher

launch procedure:
0. prepare
1. execute init hooks
2. init dependent modules
   2.1. init meta
   2.2. execute updater if exists
   2.3. init registry
3. execute before hooks
4. execute blocked function
[blocked] 6. execute grace exit, wait for exit signal

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Launch

func Launch(blocked func(ctx context.Context), opt ...Option)

Types

type HookFN

type HookFN func(ctx context.Context) error

HookFN hook function

type HookTask

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

HookTask hook task

func NewHookTask

func NewHookTask(name string, fn func(ctx context.Context) error) *HookTask

type Option

type Option func(cfg *config)

Option ...

func DisableRegistry

func DisableRegistry(disable bool) Option

DisableRegistry disable registry

func NewOptions

func NewOptions(op ...Option) []Option

NewOptions of launcher

func WithBeforeTasks

func WithBeforeTasks(tasks ...*HookTask) Option

WithBeforeTasks add before tasks

func WithConcurrencyUpdater

func WithConcurrencyUpdater(
	adaptor updater.RecordAdaptor,
	functions ...*updater.FuncInfo) Option

func WithContext

func WithContext(ctx context.Context) Option

WithContext set context

func WithInitTasks

func WithInitTasks(tasks ...*HookTask) Option

WithInitTasks add init tasks

func WithUpdater

func WithUpdater(
	adaptor updater.RecordAdaptor,
	functions ...*updater.FuncInfo) Option

Jump to

Keyboard shortcuts

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