ps

package module
v0.0.0-...-4c89809 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const RunInSerial = 0

RunInSerial is the default value for whether to run a command in parallel or not and defaults to -1 (false)

Variables

View Source
var (
	// DefaultProperties is a map of all valid ps properties with corresponding default property values
	DefaultProperties = map[string]string{
		"restart-policy": "on-failure:10",
		"procfile-path":  "",
	}

	// GlobalProperties is a map of all valid global ps properties
	GlobalProperties = map[string]bool{
		"procfile-path": true,
	}
)

Functions

func CommandInspect

func CommandInspect(appName string) error

CommandInspect displays a sanitized version of docker inspect for an app

func CommandRebuild

func CommandRebuild(appName string, allApps bool, parallelCount int) error

CommandRebuild rebuilds an app from source

func CommandReport

func CommandReport(appName string, format string, infoFlag string) error

CommandReport displays a ps report for one or more apps

func CommandRestart

func CommandRestart(appName string, processName string, allApps bool, parallelCount int) error

CommandRestart restarts an app

func CommandRestore

func CommandRestore(appName string, allApps bool, parallelCount int) error

CommandRestore starts previously running apps e.g. after reboot

func CommandRetire

func CommandRetire(appName string) error

CommandRetire ensures old containers are retired

func CommandScale

func CommandScale(appName string, skipDeploy bool, processTuples []string) error

CommandScale gets or sets how many instances of a given process to run

func CommandSet

func CommandSet(appName string, property string, value string) error

CommandSet sets or clears a ps property for an app

func CommandStart

func CommandStart(appName string, allApps bool, parallelCount int) error

CommandStart starts an app

func CommandStop

func CommandStop(appName string, allApps bool, parallelCount int) error

CommandStop stops an app

func Rebuild

func Rebuild(appName string) error

Rebuild rebuilds app from base image

func ReportSingleApp

func ReportSingleApp(appName string, format string, infoFlag string) error

ReportSingleApp is an internal function that displays the ps report for one or more apps

func Restart

func Restart(appName string) error

Restart restarts the app

func RestartProcess

func RestartProcess(appName string, processName string) error

RestartProcess restarts a process type within an app

func Restore

func Restore(appName string) error

Restore ensures an app that should be running is running on boot

func Start

func Start(appName string) error

Start starts the app

func Stop

func Stop(appName string) error

Stop stops the app

func TriggerAppRestart

func TriggerAppRestart(appName string) error

TriggerAppRestart restarts an app

func TriggerCorePostDeploy

func TriggerCorePostDeploy(appName string) error

TriggerCorePostDeploy sets a property to allow the app to be restored on boot

func TriggerCorePostExtract

func TriggerCorePostExtract(appName string, sourceWorkDir string) error

TriggerCorePostExtract ensures that the main Procfile is the one specified by procfile-path

func TriggerInstall

func TriggerInstall() error

TriggerInstall initializes app restart policies

func TriggerPostAppClone

func TriggerPostAppClone(oldAppName string, newAppName string) error

TriggerPostAppClone rebuilds the new app

func TriggerPostAppCloneSetup

func TriggerPostAppCloneSetup(oldAppName string, newAppName string) error

TriggerPostAppCloneSetup creates new ps files

func TriggerPostAppRename

func TriggerPostAppRename(oldAppName string, newAppName string) error

TriggerPostAppRename rebuilds the renamed app

func TriggerPostAppRenameSetup

func TriggerPostAppRenameSetup(oldAppName string, newAppName string) error

TriggerPostAppRenameSetup renames ps files

func TriggerPostCreate

func TriggerPostCreate(appName string) error

TriggerPostCreate ensures apps have a default restart policy and scale value for web

func TriggerPostDelete

func TriggerPostDelete(appName string) error

TriggerPostDelete destroys the ps properties for a given app container

func TriggerPostReleaseBuilder

func TriggerPostReleaseBuilder(builderType string, appName string, image string) error

TriggerPostReleaseBuilder ensures an app has an up to date scale parameters

func TriggerPostStop

func TriggerPostStop(appName string) error

TriggerPostStop sets the restore property to false

func TriggerProcfileExists

func TriggerProcfileExists(appName string) error

TriggerProcfileExists checks if a procfile exists

func TriggerProcfileGetCommand

func TriggerProcfileGetCommand(appName string, processType string, port int) error

TriggerProcfileGetCommand fetches a command from the procfile

func TriggerPsCanScale

func TriggerPsCanScale(appName string, canScale bool) error

TriggerPsCanScale sets whether or not a user can scale an app with ps:scale

func TriggerPsCurrentScale

func TriggerPsCurrentScale(appName string) error

TriggerPsCurrentScale prints out the current scale contents (process-type=quantity) delimited by newlines

func TriggerPsSetScale

func TriggerPsSetScale(appName string, skipDeploy bool, clearExisting bool, processTuples []string) error

TriggerPsSetScale configures the scale parameters for a given app

Types

type Formation

type Formation struct {
	ProcessType string `json:"process_type"`
	Quantity    int    `json:"quantity"`
}

Formation contains scaling information for a given process type

type FormationSlice

type FormationSlice []*Formation

FormationSlice contains a slice of Formations that can be sorted

func (FormationSlice) Len

func (d FormationSlice) Len() int

func (FormationSlice) Less

func (d FormationSlice) Less(i, j int) bool

func (FormationSlice) Swap

func (d FormationSlice) Swap(i, j int)

type RetireLockFailed

type RetireLockFailed struct {
	Err *error
}

RetireLockFailed wraps error to distinguish between a normal error and an error where the retire lock could not be fetched

func (*RetireLockFailed) Error

func (err *RetireLockFailed) Error() string

Error returns a standard non-existent app error

func (*RetireLockFailed) ExitCode

func (err *RetireLockFailed) ExitCode() int

ExitCode returns an exit code to use in case this error bubbles up into an os.Exit() call

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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