launchr

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 23

README

Launchr

launchr

Table of contents

Usage

Build launchr from source locally. Build dependencies:

  1. go >=1.20, see installation guide
  2. make

Build the launchr tool:

make
bin/launchr --help

The documentation for launchr usage can be found in docs.

If you face any issues with launchr:

  1. Open an issue in the repo.
  2. Share the app version with launchr --version

Installation

Installation from source

Build dependencies:

  1. go >=1.20, see installation guide
  2. make

Global installation

Install launchr globally:

make install
launchr --version

The tool will be installed in $GOPATH/bin which is usually ~/go/bin.
If GOPATH env variable is not available, make sure you have it in ~/.bashrc or ~/.zhrc:

export GOPATH=`go env GOPATH`
export PATH=$PATH:$GOPATH/bin

Local installation

The tool can be built and run locally:

make
bin/launchr --version

Development

The launchr can be built with a make to bin directory:

make

It is also supported to make a build to use with dlv for debug:

make DEBUG=1

Useful make commands:

  1. Fetch dependencies - make deps
  2. Test the code - make test
  3. Lint the code - make lint

Documentation

Overview

Package launchr has application implementation.

Index

Constants

This section is empty.

Variables

View Source
var (
	Name          = "launchr" // Name - version info
	Version       = "dev"     // Version - version info
	CustomVersion string      // CustomVersion - custom version text
)

Functions

func Gen

func Gen() int

Gen generates application specific build files and returns os exit code.

func RegisterPlugin

func RegisterPlugin(p Plugin)

RegisterPlugin add a plugin to global pull.

func Run

func Run() int

Run executes launchr application and returns os exit code.

func SetCustomVersion

func SetCustomVersion(v string)

SetCustomVersion stores custom version string for output, for example on custom build.

func ToCamelCase

func ToCamelCase(s string, capFirst bool) string

ToCamelCase converts a string to CamelCase

Types

type App

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

App holds app related global variables.

func NewApp

func NewApp() *App

NewApp constructs app implementation.

func (*App) Execute

func (app *App) Execute() int

Execute is a cobra entrypoint to the launchr app.

func (*App) Generate

func (app *App) Generate() int

Generate runs generation of included plugins.

func (*App) GetCli

func (app *App) GetCli() cli.Cli

GetCli returns application cli.

func (*App) GetWD added in v0.0.2

func (app *App) GetWD() string

GetWD provides app's working dir.

func (*App) Init

func (app *App) Init() error

Init initializes application and plugins.

func (*App) Plugins

func (app *App) Plugins() map[PluginInfo]Plugin

Plugins returns installed app plugins.

func (*App) SetCli

func (app *App) SetCli(c cli.Cli)

SetCli sets application cli.

type AppVersion

type AppVersion struct {
	Name          string
	Version       string
	OS            string
	Arch          string
	CustomVersion string
}

AppVersion stores application version.

func GetVersion

func GetVersion() *AppVersion

GetVersion provides app version info.

func (*AppVersion) String

func (v *AppVersion) String() string

type CobraPlugin

type CobraPlugin interface {
	Plugin
	CobraAddCommands(*cobra.Command) error
}

CobraPlugin is an interface to implement a plugin for cobra.

type GeneratePlugin

type GeneratePlugin interface {
	Plugin
	Generate(buildPath string, workDir string) (*PluginGeneratedData, error)
}

GeneratePlugin is an interface to generate supporting files before build.

type Plugin

type Plugin interface {
	PluginInfo() PluginInfo
	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
	Weight int
}

PluginInfo provides information about the plugin.

Directories

Path Synopsis
cmd
launchr
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.
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.
cli/streams
Package streams has functionality related to in/out/err streams.
Package streams has functionality related to in/out/err streams.
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/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.

Jump to

Keyboard shortcuts

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