# bootstrap

import "github.com/matzefriedrich/parsley/pkg/bootstrap"

# Index

  • Constants
  • Variables
  • func RunParsleyApplication(cxt context.Context, appFactoryFunc any, configure ...types.ModuleFunc) error
  • type Application

# Constants

const (
    ErrorCannotRegisterAppFactory = "cannot register application factory"
)

# Variables

ErrCannotRegisterAppFactory is returned when the application factory cannot be registered, indicating an issue with the bootstrap process.

var (
    ErrCannotRegisterAppFactory = errors.New(ErrorCannotRegisterAppFactory)
)

# func RunParsleyApplication

func RunParsleyApplication(cxt context.Context, appFactoryFunc any, configure ...types.ModuleFunc) error

RunParsleyApplication initializes and runs the Parsley application lifecycle. It registers the application factory, configures additional modules, resolves the main application instance, and invokes its Run method.

# type Application

Application provides an abstract interface for creating and running an application. It primarily facilitates the use of dependency injection for resolving services and the managing application lifecycle.

type Application interface {
    Run(context.Context) error
}