bootstrap

package
v0.0.0-...-3b4d16e Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(name, version string) (*cobra.Command, func())

Bootstrap connects the the dependency graph of the project, and returns the root command and its closer for execution.

func NewRootCmd

func NewRootCmd(name, version string) *cobra.Command

NewRootCmd returns the root command.

Types

type Core

type Core interface {
	Provide(deps di.Deps)
	AddModule(module interface{})
	AddModuleFunc(constructor interface{})
}

Core the application core interface

type Option

type Option func(c Core)

Option Global register option

func Constructors

func Constructors(constructors ...interface{}) Option

Constructors register module constructors

func Dependencies

func Dependencies(providers ...di.Deps) Option

Dependencies register global dependencies

func Modules

func Modules(modules ...interface{}) Option

Modules register modules

func Register

func Register() []Option

Register the global options includes modules, module constructors and global dependencies

Jump to

Keyboard shortcuts

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