Documentation
¶
Index ¶
- type Application
- func (app *Application) Component(name string) (component.ComponentInfo, bool)
- func (app *Application) Components() []component.ComponentInfo
- func (app *Application) ExecuteContext(ctx context.Context) error
- func (app *Application) Exit()
- func (app *Application) GetCertPath() string
- func (app *Application) GetConfigFile() string
- func (app *Application) GetContext() context.Context
- func (app *Application) GetLogger() *zap.Logger
- func (app *Application) GetRemoterWorkDir() string
- func (app *Application) GetWorkDir() string
- func (app *Application) Register(components ...component.Component) error
- func (app *Application) Resolve(name string) (any, bool)
- func (app *Application) RootCommand() *cobra.Command
- func (app *Application) Submit(task func()) error
- type Config
- type Option
- func WithCertPath(path string) Option
- func WithConfigFile(path string) Option
- func WithGoPs(enabled bool) Option
- func WithLogger(logger *zap.Logger) Option
- func WithPoolSize(size int) Option
- func WithPyroscope(enabled bool) Option
- func WithRemoteWorkDir(path string) Option
- func WithWorkDir(path string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application is the NCP composition root and component lifecycle owner.
func New ¶
func New(options ...Option) (*Application, error)
func (*Application) Component ¶
func (app *Application) Component(name string) (component.ComponentInfo, bool)
func (*Application) Components ¶
func (app *Application) Components() []component.ComponentInfo
func (*Application) ExecuteContext ¶
func (app *Application) ExecuteContext(ctx context.Context) error
func (*Application) Exit ¶
func (app *Application) Exit()
func (*Application) GetCertPath ¶
func (app *Application) GetCertPath() string
func (*Application) GetConfigFile ¶
func (app *Application) GetConfigFile() string
func (*Application) GetContext ¶
func (app *Application) GetContext() context.Context
func (*Application) GetLogger ¶
func (app *Application) GetLogger() *zap.Logger
func (*Application) GetRemoterWorkDir ¶
func (app *Application) GetRemoterWorkDir() string
func (*Application) GetWorkDir ¶
func (app *Application) GetWorkDir() string
func (*Application) Register ¶
func (app *Application) Register(components ...component.Component) error
Register adds components to the composition root. Constructors are expected to be side-effect free; commands and services are discovered explicitly here.
func (*Application) RootCommand ¶
func (app *Application) RootCommand() *cobra.Command
func (*Application) Submit ¶
func (app *Application) Submit(task func()) error
type Option ¶
type Option func(*Application)