initialisation

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitData

type InitData[T modconfig.ModTreeItem] struct {
	Workspace       *workspace.Workspace
	WorkspaceEvents *dashboardworkspace.WorkspaceEvents
	Result          *InitResult

	ShutdownTelemetry func()
	ExportManager     *export.Manager
	Targets           []modconfig.ModTreeItem
	DefaultClient     *db_client.DbClient
}

func NewErrorInitData

func NewErrorInitData[T modconfig.ModTreeItem](err error) *InitData[T]

func NewInitData

func NewInitData[T modconfig.ModTreeItem](ctx context.Context, cmd *cobra.Command, cmdArgs ...string) *InitData[T]

func (*InitData[T]) Cleanup

func (i *InitData[T]) Cleanup(ctx context.Context)

func (*InitData[T]) GetSingleTarget

func (i *InitData[T]) GetSingleTarget() (modconfig.ModTreeItem, error)

GetSingleTarget validates there is only a single target and returns it

func (*InitData[T]) Init

func (i *InitData[T]) Init(ctx context.Context, args ...string)

func (*InitData[T]) RegisterExporters

func (i *InitData[T]) RegisterExporters(exporters ...export.Exporter) error

type InitResult

type InitResult struct {
	error_helpers.ErrorAndWarnings
	Messages []string

	// allow overriding of the display functions
	DisplayMessage func(ctx context.Context, m string)
	DisplayWarning func(ctx context.Context, w string)
}

func (*InitResult) AddMessage

func (r *InitResult) AddMessage(messages ...string)

func (*InitResult) AddWarnings

func (r *InitResult) AddWarnings(warnings ...string)

func (*InitResult) DisplayMessages

func (r *InitResult) DisplayMessages()

func (*InitResult) HasMessages

func (r *InitResult) HasMessages() bool

func (*InitResult) Merge

func (r *InitResult) Merge(other InitResult)

Jump to

Keyboard shortcuts

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