fury

package module
v0.0.0-...-a91e3db Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

README

Fury config management

license Travis api

Fury is a very opinionated configuration management tool, operating in a similar space to Puppet, Chef, Ansible, Saltstack and the like. It's not at all production-ready, you should never use it.

I wrote it because I have strange opinions about what my ideal config management system would be, and why I think all existing systems are getting it fundamentally wrong. It's very unlikely that I'm correct, but exploring the depths of my wrongness is entertaining, and might result in something that I at least like using.

This is not an official Google project, if you hadn't guessed by now.

Documentation

Overview

Package fury implements a minimalist machine configuration management system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Applier

type Applier interface {
	Apply(Runner) error
}

An Applier applies its state to a Runner.

type Command

type Command struct {
	// Path is the path of the command to run.
	//
	// This is the only field that must be set to a non-zero
	// value. If Path is relative, it is evaluated relative
	// to Dir.
	Path string

	// Args holds command line arguments.
	Args []string

	// Env specifies the environment of the process.
	Env map[string]string

	// Dir specifies the working directory of the command.
	// If Dir is the empty string, the working directory is /.
	Dir string

	// Stdin specifies the process's standard input.
	// If Stdin is nil, the process reads from the null device (os.DevNull).
	Stdin io.Reader

	// Stdout and Stderr specify the process's standard output and error.
	//
	// If either is nil, Run connects the corresponding file descriptor
	// to the null device (os.DevNull).
	//
	// If Stdout and Stderr are the same writer, at most one
	// goroutine at a time will call Write.
	Stdout io.Writer
	Stderr io.Writer
}

A Command represents an external program to run.

type ExitStatus

type ExitStatus struct {
	Status int
}

ExitStatus stores information about an executed Command.

func (ExitStatus) Error

func (e ExitStatus) Error() string

type Runner

type Runner interface {
	// Run executes cmd.
	// The returned error is nil if the command runs, has no problems
	// copying stdin, stdout, and stderr, and exits with a zero exit
	// status.
	Run(cmd *Command) error
}

A Runner executes external programs.

type SSH

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

SSH runs commands over an SSH connection.

func NewRawSSH

func NewRawSSH(ssh *ssh.Client) *SSH

NewRawSSH builds an SSH from an open ssh.Client connection.

func NewSSH

func NewSSH(addr string) (*SSH, error)

NewSSH builds an SSH connected to the given address.

The connection is made as root, and authenticated with the resident SSH authentication agent.

func (*SSH) Close

func (s *SSH) Close() error

Close closes the session.

func (*SSH) Run

func (s *SSH) Run(cmd *Command) error

Run executes cmd on the remote host.

Jump to

Keyboard shortcuts

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