Back to godoc.org
github.com/juju/juju/worker/uniter/runner/debug

package debug

v0.0.0 (4dcf1d7)
Latest Go to latest
Published: 1 day ago | License: AGPL-3.0 | Module: github.com/juju/juju

Index

func Base64HookArgs

func Base64HookArgs(match []string, debugAt string) string

Base64HookArgs returns the encoded arguments for defining debug-hook behavior. This is a base64 encoded yaml blob containing serialized arguments.

func ClientScript

func ClientScript(c *HooksContext, match []string, debugAt string) string

ClientScript returns a bash script suitable for executing on the unit system to intercept matching hooks or actions via tmux shell.

type HooksContext

type HooksContext struct {
	Unit     string
	FlockDir string
}

func NewHooksContext

func NewHooksContext(unitName string) *HooksContext

func (*HooksContext) ClientExitFileLock

func (c *HooksContext) ClientExitFileLock() string

func (*HooksContext) ClientFileLock

func (c *HooksContext) ClientFileLock() string

func (*HooksContext) FindSession

func (c *HooksContext) FindSession() (*ServerSession, error)

FindSession attempts to find a debug hooks session for the unit specified in the context, and returns a new ServerSession structure for it.

type ServerSession

type ServerSession struct {
	*HooksContext
	// contains filtered or unexported fields
}

ServerSession represents a "juju debug-hooks" session.

func (*ServerSession) DebugAt

func (s *ServerSession) DebugAt() string

DebugAt returns the location for the charm to stop for debugging, if it is set.

func (*ServerSession) MatchHook

func (s *ServerSession) MatchHook(hookName string) bool

MatchHook returns true if the specified hook name matches the hook specified by the debug-hooks client.

func (*ServerSession) RunHook

func (s *ServerSession) RunHook(hookName, charmDir string, env []string, hookRunner string) error

RunHook "runs" the hook with the specified name via debug-hooks. The hookRunner parameters specifies the name of the binary that users can invoke to handle the hook. When using the legacy hook system, hookRunner will be equal to the hookName; otherwise, it will point to a script that acts as the dispatcher for all hooks/actions.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier