run

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRunSocketPath = "/tmp/savvy-run.sock"

Variables

View Source
var ErrAbortRun = errors.New("abort running runbook")
View Source
var ErrStartingRunSession = errors.New("failed to start run session")

Functions

This section is empty.

Types

type Client

type Client interface {
	server.ShutdownSender
	NextCommand() error
	PreviousCommand() error
	CurrentState() (*State, error)
	SetParams(params map[string]string) error
}

func NewClient

func NewClient(ctx context.Context, socketPath string) (Client, error)

func NewDefaultClient

func NewDefaultClient(ctx context.Context) (Client, error)

type Option

type Option func(s *RunServer)

func WithLogger

func WithLogger(logger *slog.Logger) Option

type RunCommand

type RunCommand struct {
	Command string            `json:"command,omitempty"`
	Params  map[string]string `json:"params,omitempty"`
}

func (*RunCommand) IsShutdown

func (rc *RunCommand) IsShutdown() bool

type RunServer

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

func NewServerWithDefaultSocketPath

func NewServerWithDefaultSocketPath(rb *savvy_client.Runbook, opts ...Option) (*RunServer, error)

func NewServerWithSocketPath

func NewServerWithSocketPath(socketPath string, rb *savvy_client.Runbook, opts ...Option) (*RunServer, error)

func (*RunServer) Close

func (rs *RunServer) Close() error

func (*RunServer) Commands

func (rs *RunServer) Commands() []*RunCommand

func (*RunServer) ListenAndServe

func (rs *RunServer) ListenAndServe()

func (*RunServer) SocketPath

func (rs *RunServer) SocketPath() string

type State

type State struct {
	Command string            `json:"command"`
	Index   int               `json:"index"`
	Params  map[string]string `json:"params"`
}

func (*State) CommandWithSetParams added in v0.12.0

func (s *State) CommandWithSetParams() string

Jump to

Keyboard shortcuts

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