sync_commands

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name         string            `koanf:"name"`
	Disabled     bool              `koanf:"disabled"`
	AllowFailure bool              `koanf:"allow_failure"`
	Cmd          string            `koanf:"cmd"`
	Args         []string          `koanf:"args"`
	Environment  map[string]string `koanf:"environment"`
	StreamOutput bool              `koanf:"stream_output"`
	// contains filtered or unexported fields
}

Command is a command to run, contains valid templated strings

func (*Command) ExecuteWithData

func (c *Command) ExecuteWithData(data CommandTemplateData) (err error)

ExecuteWithData executes the command with the provided template data

func (*Command) Parse

func (c *Command) Parse() (err error)

NewCommand creates a new Command from a config

type CommandTemplateData

type CommandTemplateData struct {
	CommandIndex                int
	CommandsCount               int
	ValidatorClient             string
	ValidatorRPCURL             string
	ValidatorRole               string
	ValidatorRoleIsPassive      bool
	ValidatorRoleIsActive       bool
	ValidatorIdentityPublicKey  string
	ClusterName                 string
	VersionFrom                 string
	VersionTo                   string
	SyncIsSFDPComplianceEnabled bool
}

CommandTemplateData represents the data available for command template interpolation

type ExecOptions

type ExecOptions struct {
	ExecLogger    *log.Logger
	CommandIndex  int
	CommandsCount int
	Disabled      bool
	AllowFailure  bool
	Cmd           string
	Args          []string
	Environment   map[string]string
	StreamOutput  bool
}

func (*ExecOptions) EnvironmentSlice

func (o *ExecOptions) EnvironmentSlice() []string

EnvironmentSlice returns the environment variables as a slice of strings

Jump to

Keyboard shortcuts

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