base

package
v0.0.0-...-740721f Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	CheckCmd  string
	EnsureCmd string
	User      string
}

Cmd can be used to do a simple command based rule

func (Cmd) Ensure

func (c Cmd) Ensure(h *gossh.Host) (gossh.Status, error)

Ensure simply runs Cmd's CheckCmd, then EnsureCmd

type Meta

type Meta struct {
	EnsureFunc func(h *gossh.Host) (gossh.Status, error)
}

Meta is a rule that can be used to write your own rules, on the fly

func NewMeta

func NewMeta(ensure func(h *gossh.Host) (gossh.Status, error)) Meta

NewMeta can be used to create a new Meta rule

func (Meta) Ensure

func (ma Meta) Ensure(h *gossh.Host) (gossh.Status, error)

Ensure runs EnsureFunc

type Multi

type Multi []gossh.Rule

Multi is a rule that consists of a list of rules

Check will allways return false and nil and only serves as a building block for nested rules.

func (*Multi) Add

func (p *Multi) Add(r gossh.Rule)

Add adds a rule to Multi p

func (Multi) Ensure

func (p Multi) Ensure(h *gossh.Host) (gossh.Status, error)

Ensure implements Ensurer

Ensure runs Check and Ensure on all rules in the lish.

Multi will stop executing and return an error if encountering an error from any Check or Ensure method.

Jump to

Keyboard shortcuts

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