Documentation
¶
Overview ¶
Package launchr has application implementation.
Index ¶
- Variables
- func Gen() int
- func GetPluginByType[T Plugin](app *App) []T
- func GetService[T Service](app *App) T
- func RegisterPlugin(p Plugin)
- func Run() int
- func SetCustomVersion(v string)
- func ToCamelCase(s string, capFirst bool) string
- type App
- type AppVersion
- type CobraPlugin
- type GeneratePlugin
- type GlobalConfig
- type GlobalConfigAware
- type Plugin
- type PluginGeneratedData
- type PluginInfo
- type PluginManager
- type Service
- type ServiceInfo
Constants ¶
This section is empty.
Variables ¶
var ( // GetFsAbsPath returns absolute path for an FS struct. GetFsAbsPath = launchr.GetFsAbsPath // EnsurePath creates all directories in the path. EnsurePath = launchr.EnsurePath )
Reexport for usage by other modules.
var ( Name = "launchr" // Name - version info Version = "dev" // Version - version info CustomVersion string // CustomVersion - custom version text )
var ActionsGroup = &cobra.Group{
ID: "actions",
Title: "Actions:",
}
ActionsGroup is a cobra command group definition
Functions ¶
func GetPluginByType ¶ added in v0.0.8
GetPluginByType returns specific plugins from the app.
func GetService ¶ added in v0.0.8
GetService returns a service from the app. It uses generics to find the exact service.
func SetCustomVersion ¶
func SetCustomVersion(v string)
SetCustomVersion stores custom version string for output, for example on custom build.
func ToCamelCase ¶
ToCamelCase converts a string to CamelCase
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App holds app related global variables.
func (*App) AddService ¶ added in v0.0.9
AddService registers a service in the app.
type AppVersion ¶
AppVersion stores application version.
func (*AppVersion) String ¶
func (v *AppVersion) String() string
type CobraPlugin ¶
type CobraPlugin interface {
Plugin
// CobraAddCommands is a hook called when cobra root command is available.
// Plugins may register its command line commands here.
CobraAddCommands(*cobra.Command) error
}
CobraPlugin is an interface to implement a plugin for cobra.
type GeneratePlugin ¶
type GeneratePlugin interface {
Plugin
// Generate is a function called when application is generating code and assets for the build.
Generate(buildPath string, workDir string) (*PluginGeneratedData, error)
}
GeneratePlugin is an interface to generate supporting files before build.
type GlobalConfig ¶ added in v0.0.9
type GlobalConfig = config.GlobalConfig
GlobalConfig handles global configuration.
type GlobalConfigAware ¶ added in v0.0.9
type GlobalConfigAware = config.GlobalConfigAware
GlobalConfigAware provides an interface for structs to support global configuration setting.
type Plugin ¶
type Plugin interface {
// PluginInfo requests a type to provide information about the plugin.
// The Plugin info is used as a unique data to indentify a plugin.
PluginInfo() PluginInfo
// InitApp is hook function called on application initialisation.
// Plugins may save app global object, retrieve or provide services here.
InitApp(app *App) error
}
Plugin is a common interface for launchr plugins.
type PluginGeneratedData ¶
type PluginGeneratedData struct {
Plugins []string
}
PluginGeneratedData is a struct containing a result information of plugin generation.
type PluginInfo ¶
type PluginInfo struct {
ID string
}
PluginInfo provides information about the plugin and is used as a unique data to indentify a plugin.
type PluginManager ¶ added in v0.0.8
type PluginManager interface {
Service
All() map[PluginInfo]Plugin
}
PluginManager handles plugins.
type ServiceInfo ¶ added in v0.0.8
type ServiceInfo = launchr.ServiceInfo
ServiceInfo provides service info for its initialization.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
launchr
command
Package executes Launchr application.
|
Package executes Launchr application. |
|
launchr/gen
Package gen is here to provide example structure for the built app.
|
Package gen is here to provide example structure for the built app. |
|
internal
|
|
|
launchr
Package launchr provides common app functionality.
|
Package launchr provides common app functionality. |
|
launchr/config
Package config provides global app config object.
|
Package config provides global app config object. |
|
pkg
|
|
|
action
Package action provides implementations of discovering and running actions.
|
Package action provides implementations of discovering and running actions. |
|
cli
Package cli implements printing functionality for CLI output.
|
Package cli implements printing functionality for CLI output. |
|
driver
Package driver hold implementation for action drivers.
|
Package driver hold implementation for action drivers. |
|
driver/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
jsonschema
Package jsonschema has functionality related to json schema support.
|
Package jsonschema has functionality related to json schema support. |
|
log
Package log is meant to provide a global logger for the application and provide logging functionality interface.
|
Package log is meant to provide a global logger for the application and provide logging functionality interface. |
|
plugins
Package plugins provides launchr core plugins.
|
Package plugins provides launchr core plugins. |
|
plugins/builder
Package builder implements launchr functionality to build itself.
|
Package builder implements launchr functionality to build itself. |
|
plugins/verbosity
Package verbosity is a plugin of launchr to configure log level of the app.
|
Package verbosity is a plugin of launchr to configure log level of the app. |
|
plugins/yamldiscovery
Package yamldiscovery implements a launchr plugin to discover actions defined in yaml.
|
Package yamldiscovery implements a launchr plugin to discover actions defined in yaml. |
|
plugins/yamldiscovery/embed
Package embed provides yaml discovery with embed actions definition.
|
Package embed provides yaml discovery with embed actions definition. |
|
types
Package types contains launchr common types.
|
Package types contains launchr common types. |