cmds

package
v0.0.0-...-1509d7a Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package cmds has command line command.

Index

Constants

View Source
const (
	ProcessNameConfig     = "config"
	HookNameConfigStorage = "config_storage"
)
View Source
const (
	ProcessNameHosts                   = "hosts"
	HookNameCleanStoppedNodeContainers = "clean_stopped_node_containers"
)
View Source
const (
	ProcessNameLogWatcher   = "log_watcher"
	HookNameStopLogHandlers = "stop_log_handlers"
)
View Source
const (
	ProcessNameMongodb   = "mongodb"
	HookNameCloseMongodb = "close_mongodb"
)
View Source
const (
	HookNameBase = "base"
)
View Source
const HookNameCleanContainers = "clean_containers"
View Source
const HookNameContestReady = "contest_ready"
View Source
const HookNameVars = "vars"
View Source
const ProcessNameLogSaver = "log_saver"
View Source
const ProcessNameNodes = "nodes"

Variables

View Source
var (
	ContextValueExitError util.ContextKey = "exit_error"
	ContextValueExitChan  util.ContextKey = "exit_chan"
)
View Source
var (
	ProcessorHosts     pm.Process
	HookNameCloseHosts = "close_hosts"
)
View Source
var ActionLoaders = map[string]LoadAction{
	"init-nodes":   initNodesActionFunc,
	"start-nodes":  startNodesActionFunc,
	"custom-nodes": customNodesActionFunc,
	"stop-nodes":   stopNodesActionFunc,
	"kill":         killActionFunc,
	"host-command": hostCommandActionFunc,
}
View Source
var ProcessorConfig pm.Process
View Source
var ProcessorLogSaver pm.Process
View Source
var ProcessorLogWatcher pm.Process
View Source
var ProcessorMongodb pm.Process
View Source
var ProcessorNodes pm.Process

Functions

func HookBase

func HookBase(ctx context.Context) (context.Context, error)

func HookCleanContainers

func HookCleanContainers(ctx context.Context) (context.Context, error)

func HookCleanStoppedNodeContainers

func HookCleanStoppedNodeContainers(ctx context.Context) (context.Context, error)

func HookCloseHosts

func HookCloseHosts(ctx context.Context) (context.Context, error)

func HookCloseMongodb

func HookCloseMongodb(ctx context.Context) (context.Context, error)

func HookConfigStorage

func HookConfigStorage(ctx context.Context) (context.Context, error)

func HookContestReady

func HookContestReady(ctx context.Context) (context.Context, error)

func HookStopLogHandlers

func HookStopLogHandlers(ctx context.Context) (context.Context, error)

func HookVars

func HookVars(ctx context.Context) (context.Context, error)

func LoadExitChanContextValue

func LoadExitChanContextValue(ctx context.Context, l *chan error) error

func LoadExitErrorContextValue

func LoadExitErrorContextValue(ctx context.Context, l *error) error

func NewHostCommandAction

func NewHostCommandAction(ctx context.Context, args []string) (host.Action, error)

func ProcessConfig

func ProcessConfig(ctx context.Context) (context.Context, error)

func ProcessHosts

func ProcessHosts(ctx context.Context) (context.Context, error)

func ProcessLogSaver

func ProcessLogSaver(ctx context.Context) (context.Context, error)

func ProcessLogWatcher

func ProcessLogWatcher(ctx context.Context) (context.Context, error)

func ProcessMongodb

func ProcessMongodb(ctx context.Context) (context.Context, error)

func ProcessNodes

func ProcessNodes(ctx context.Context) (context.Context, error)

Types

type BaseNodesAction

type BaseNodesAction struct {
	*logging.Logging
	// contains filtered or unexported fields
}

func NewBaseNodesAction

func NewBaseNodesAction(ctx context.Context, name string, aliases []string, args []string) (*BaseNodesAction, error)

func (BaseNodesAction) Map

func (ac BaseNodesAction) Map() map[string]interface{}

func (*BaseNodesAction) Name

func (ac *BaseNodesAction) Name() string

type CustomNodesAction

type CustomNodesAction struct {
	*BaseNodesAction
}

func NewCustomNodesAction

func NewCustomNodesAction(ctx context.Context, aliases []string, args []string) (*CustomNodesAction, error)

func (CustomNodesAction) MarshalJSON

func (ac CustomNodesAction) MarshalJSON() ([]byte, error)

func (*CustomNodesAction) Run

func (ac *CustomNodesAction) Run(ctx context.Context) error

type HostCommandAction

type HostCommandAction struct {
	*logging.Logging
	// contains filtered or unexported fields
}

func (*HostCommandAction) Map

func (ac *HostCommandAction) Map() map[string]interface{}

func (HostCommandAction) MarshalJSON

func (ac HostCommandAction) MarshalJSON() ([]byte, error)

func (*HostCommandAction) Name

func (*HostCommandAction) Name() string

func (*HostCommandAction) Run

func (ac *HostCommandAction) Run(ctx context.Context) error

type InitNodesAction

type InitNodesAction struct {
	*BaseNodesAction
}

func NewInitNodesAction

func NewInitNodesAction(ctx context.Context, aliases []string) (*InitNodesAction, error)

func (InitNodesAction) MarshalJSON

func (ac InitNodesAction) MarshalJSON() ([]byte, error)

func (*InitNodesAction) Run

func (ac *InitNodesAction) Run(ctx context.Context) error

type KillAction

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

func (KillAction) MarshalJSON

func (KillAction) MarshalJSON() ([]byte, error)

func (KillAction) Name

func (KillAction) Name() string

func (KillAction) Run

func (ac KillAction) Run(_ context.Context) error

type LoadAction

type LoadAction func(context.Context, config.DesignAction) (host.Action, error)

type RunCommand

type RunCommand struct {
	*logging.Logging
	*mitumcmds.LogFlags
	RunnerFile    string             `arg:"" name:"runner-file" type:"existingfile"`
	Design        mitumcmds.FileLoad `arg:"" name:"contest design file" help:"contest design file"`
	ContestLogDir string             `name:"contest-log-dir" help:"contest logs directory"`
	Force         bool               `name:"force" help:"kill the still running node containers"`
	CleanAfter    bool               `name:"clean-after" help:"clean node containers after exit"`
	ExitAfter     time.Duration      `name:"exit-after" help:"exit contest"`
	ConfigOnly    bool               `name:"config-only" help:"exit after config"`
	// contains filtered or unexported fields
}

func NewRunCommand

func NewRunCommand() (RunCommand, error)

func (*RunCommand) Run

func (cmd *RunCommand) Run(version util.Version) error

type StartNodesAction

type StartNodesAction struct {
	*BaseNodesAction
}

func NewStartNodesAction

func NewStartNodesAction(ctx context.Context, aliases []string, args []string) (*StartNodesAction, error)

func (StartNodesAction) MarshalJSON

func (ac StartNodesAction) MarshalJSON() ([]byte, error)

func (*StartNodesAction) Run

func (ac *StartNodesAction) Run(ctx context.Context) error

type StopNodesAction

type StopNodesAction struct {
	*BaseNodesAction
}

func NewStopNodesAction

func NewStopNodesAction(ctx context.Context, aliases []string) (*StopNodesAction, error)

func (StopNodesAction) MarshalJSON

func (ac StopNodesAction) MarshalJSON() ([]byte, error)

func (*StopNodesAction) Run

func (ac *StopNodesAction) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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