cli_entrypoint

package
v0.51.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ConfigSetFuncFromFS builds a ConfigSetFunc which parses a file in a FS as a ConfigSet.

Functions

func DefaultStatePath

func DefaultStatePath(projectID string) string

DefaultStatePath returns the default state path for the CLI.

func Main

func Main(
	appName string,
	projectID string,
	factories []AddFactoryFunc,
	configSets []BuildConfigSetFunc,
	commandBuilders []BuildCommandsFunc,
)

Main boots the CliBus and runs the CLI application.

func StatePathEnvVar

func StatePathEnvVar(projectID string) string

StatePathEnvVar returns the project-specific state path environment variable.

func StatePathEnvVars

func StatePathEnvVars(projectID string) []string

StatePathEnvVars returns the environment variables that override the state path.

Types

type AddFactoryFunc

type AddFactoryFunc = plugin_entrypoint.AddFactoryFunc

AddFactoryFunc is a callback to add a factory.

type BuildCommandsFunc

type BuildCommandsFunc func(getBus func() CliBus) []*cli.Command

BuildCommandsFunc is a function to build CLI commands.

type BuildConfigSetFunc

type BuildConfigSetFunc = plugin_entrypoint.BuildConfigSetFunc

BuildConfigSetFunc is a function to build a list of ConfigSet to apply.

type CliBus

type CliBus interface {
	// GetContext returns the bus context.
	GetContext() context.Context
	// GetBus returns the controller bus.
	GetBus() bus.Bus
	// GetLogger returns the root logger.
	GetLogger() *logrus.Entry
	// GetVolume returns the volume used for state.
	GetVolume() volume.Volume
	// GetWorldEngineID returns the world engine ID.
	GetWorldEngineID() string
	// GetWorldEngine returns the world engine instance.
	GetWorldEngine() world.Engine
	// GetWorldState returns the world state instance.
	GetWorldState() world.WorldState
	// GetPluginHostObjectKey returns the plugin host object key.
	GetPluginHostObjectKey() string
	// Release releases all resources held by the bus.
	Release()
}

CliBus is the common interface for CLI bus implementations.

type CliBusImpl

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

CliBusImpl implements the CliBus interface for CLI binaries.

func BuildCliBus

func BuildCliBus(rctx context.Context, le *logrus.Entry, stateRoot string) (*CliBusImpl, error)

BuildCliBus builds a lightweight bus for CLI binaries.

func (*CliBusImpl) GetBus

func (c *CliBusImpl) GetBus() bus.Bus

GetBus returns the controller bus.

func (*CliBusImpl) GetContext

func (c *CliBusImpl) GetContext() context.Context

GetContext returns the bus context.

func (*CliBusImpl) GetLogger

func (c *CliBusImpl) GetLogger() *logrus.Entry

GetLogger returns the root logger.

func (*CliBusImpl) GetPluginHostObjectKey

func (c *CliBusImpl) GetPluginHostObjectKey() string

GetPluginHostObjectKey returns the plugin host object key.

func (*CliBusImpl) GetStaticResolver

func (c *CliBusImpl) GetStaticResolver() *static.Resolver

GetStaticResolver returns the static controller resolver.

func (*CliBusImpl) GetVolume

func (c *CliBusImpl) GetVolume() volume.Volume

GetVolume returns the volume used for state.

func (*CliBusImpl) GetWorldEngine

func (c *CliBusImpl) GetWorldEngine() world.Engine

GetWorldEngine returns the world engine instance.

func (*CliBusImpl) GetWorldEngineID

func (c *CliBusImpl) GetWorldEngineID() string

GetWorldEngineID returns the world engine ID.

func (*CliBusImpl) GetWorldState

func (c *CliBusImpl) GetWorldState() world.WorldState

GetWorldState returns the world state instance.

func (*CliBusImpl) Release

func (c *CliBusImpl) Release()

Release releases all resources held by the bus.

Jump to

Keyboard shortcuts

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