startup

package
v0.1.290-herb-context-... Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonStartup added in v0.1.243

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

CommonStartup ...

func (*CommonStartup) AddHooks added in v0.1.243

func (s *CommonStartup) AddHooks(hooks ...*Hooks)

AddHooks setter

func (*CommonStartup) GetContainer added in v0.1.243

func (s *CommonStartup) GetContainer() di.Container

GetContainer setter

func (*CommonStartup) GetHooks added in v0.1.243

func (s *CommonStartup) GetHooks() []*Hooks

GetHooks getter

func (*CommonStartup) SetContainer added in v0.1.243

func (s *CommonStartup) SetContainer(container di.Container)

SetContainer setter

type Hooks added in v0.1.243

type Hooks struct {
	PrebuildHook    func(builder *di.Builder) error
	PostBuildHook   func(container di.Container) error
	PreStartHook    func(echo *echo.Echo) error
	PreShutdownHook func(echo *echo.Echo) error
}

Hooks into the startup pipeline

type IStartup

type IStartup interface {
	// Config
	// SetHooks lets us add services at that end of the main ConfigServices chain
	// Typically used for unit testing where mocks are swapped in.
	AddHooks(hooks ...*Hooks)
	GetHooks() []*Hooks

	GetContainer() di.Container

	// 1. GetConfigOptions
	GetConfigOptions() *core_contracts.ConfigOptions
	// 2.a ConfigureServices
	// 2.b Call PreBuildHook if it is present
	ConfigureServices(builder *di.Builder) error
	// 3. SetContainer
	SetContainer(container di.Container)
	// 4. Configure
	Configure(e *echo.Echo, root di.Container) error
	// 5. RegisterStaticRoutes
	// i.e. e.Static("/css", "./css")
	RegisterStaticRoutes(e *echo.Echo) error
	// 6. GetOptions
	GetOptions() *Options
}

IStartup for echo apps

type Options

type Options struct {
	Port int
}

Options for echo apps

Jump to

Keyboard shortcuts

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