process

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChildProcessKey = "process"
	ServiceKey      = "service"
	TaskKey         = "task"
)

Variables

This section is empty.

Functions

func EncodeScriptTask added in v0.3.2

func EncodeScriptTask(task *Task) (props map[string]any, headers map[string]any)

func EncodeServiceTask added in v0.3.2

func EncodeServiceTask(service *Service) (props map[string]any, headers map[string]any)

Types

type ChildProcess

type ChildProcess struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	Id   string `json:"id,omitempty" yaml:"id,omitempty"`
	Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`

	Hosts []string `json:"hosts,omitempty" yaml:"hosts,omitempty"`

	Vars map[string]any `json:"vars,omitempty" yaml:"vars,omitempty"`

	RemoteUser string `json:"remote_user,omitempty" yaml:"remote_user,omitempty"`

	Sudo     bool   `json:"sudo,omitempty" yaml:"sudo,omitempty"`
	SudoUser string `json:"sudo_user,omitempty" yaml:"sudo_user,omitempty"`

	Tasks []ITask `json:"tasks,omitempty" yaml:"tasks,omitempty"`

	Handlers []*Handler `json:"handlers,omitempty" yaml:"handlers,omitempty"`
}

type Handler

type Handler struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	Id   string `json:"id,omitempty" yaml:"id,omitempty"`
	Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`

	Action string         `json:"action,omitempty" yaml:"action,omitempty"`
	Args   map[string]any `json:"args,omitempty" yaml:"args,omitempty"`
}

func (*Handler) String added in v0.3.0

func (h *Handler) String() string

type ICatchTask added in v0.3.0

type ICatchTask interface {
	GetHosts() []string
	GetCatch() *Handler
	GetFinish() *Handler
}

type INamedTask added in v0.3.0

type INamedTask interface {
	GetName() string
	GetId() string
}

type ITask

type ITask interface {
	// contains filtered or unexported methods
}

type Process

type Process struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	Id   string `json:"id,omitempty" yaml:"id,omitempty"`

	Hosts []string `json:"hosts,omitempty" yaml:"hosts,omitempty"`

	Vars map[string]any `json:"vars,omitempty" yaml:"vars,omitempty"`

	RemoteUser string `json:"remote_user,omitempty" yaml:"remote_user,omitempty"`

	Sudo     bool   `json:"sudo,omitempty" yaml:"sudo,omitempty"`
	SudoUser string `json:"sudo_user,omitempty" yaml:"sudo_user,omitempty"`

	Tasks []ITask `json:"tasks,omitempty" yaml:"tasks,omitempty"`

	Handlers []*Handler `json:"handlers,omitempty" yaml:"handlers,omitempty"`
}

func (*Process) Build added in v0.3.2

func (p *Process) Build() (*schema.Definitions, map[string]string, map[string]string, error)

func (*Process) SubBuild added in v0.3.2

func (p *Process) SubBuild() (*schema.Definitions, map[string]string, map[string]string, error)

func (*Process) UnmarshalYAML

func (p *Process) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

type Service added in v0.2.2

type Service struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	Id   string `json:"id,omitempty" yaml:"id,omitempty"`

	Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`

	Vars map[string]any `json:"vars,omitempty" yaml:"vars,omitempty"`

	Hosts []string `json:"hosts,omitempty" yaml:"hosts,omitempty"`

	Action string         `json:"action,omitempty" yaml:"action,omitempty"`
	Args   map[string]any `json:"args,omitempty" yaml:"args,omitempty"`

	Catch  *Handler `json:"catch,omitempty" yaml:"catch,omitempty"`
	Finish *Handler `json:"finish,omitempty" yaml:"finish,omitempty"`

	Notify []string `json:"notify,omitempty" yaml:"notify,omitempty"`
}

func DecodeServiceTask added in v0.3.2

func DecodeServiceTask(props, headers map[string]any) *Service

func (*Service) GetCatch added in v0.3.0

func (s *Service) GetCatch() *Handler

func (*Service) GetFinish added in v0.3.0

func (s *Service) GetFinish() *Handler

func (*Service) GetHosts added in v0.3.0

func (s *Service) GetHosts() []string

func (*Service) GetId added in v0.3.0

func (s *Service) GetId() string

func (*Service) GetName added in v0.3.0

func (s *Service) GetName() string

type Task

type Task struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	Id   string `json:"id,omitempty" yaml:"id,omitempty"`

	Vars map[string]any `json:"vars,omitempty" yaml:"vars,omitempty"`

	Action string         `json:"action,omitempty" yaml:"action,omitempty"`
	Args   map[string]any `json:"args,omitempty" yaml:"args,omitempty"`

	RemoteUser string `json:"remote_user,omitempty" yaml:"remote_user,omitempty"`

	Sudo     bool   `json:"sudo,omitempty" yaml:"sudo,omitempty"`
	SudoUser string `json:"sudo_user,omitempty" yaml:"sudo_user,omitempty"`

	Hosts []string `json:"hosts,omitempty" yaml:"hosts,omitempty"`

	Catch  *Handler `json:"catch,omitempty" yaml:"catch,omitempty"`
	Finish *Handler `json:"finish,omitempty" yaml:"finish,omitempty"`

	Notify []string `json:"notify,omitempty" yaml:"notify,omitempty"`
}

func DecodeScriptTask added in v0.3.2

func DecodeScriptTask(props, headers map[string]any) *Task

func (*Task) GetCatch added in v0.3.0

func (t *Task) GetCatch() *Handler

func (*Task) GetFinish added in v0.3.0

func (t *Task) GetFinish() *Handler

func (*Task) GetHosts added in v0.3.0

func (t *Task) GetHosts() []string

func (*Task) GetId added in v0.3.0

func (t *Task) GetId() string

func (*Task) GetName added in v0.3.0

func (t *Task) GetName() string

type YamlKV

type YamlKV map[string]interface{}

func (YamlKV) Apply

func (kv YamlKV) Apply(name string, to any) (bool, error)

func (YamlKV) ApplyArray

func (kv YamlKV) ApplyArray(name string, to any) (bool, error)

func (YamlKV) ApplyMap

func (kv YamlKV) ApplyMap(name string, to any) (bool, error)

func (YamlKV) GetRV

func (kv YamlKV) GetRV(name string) (reflect.Value, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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