genesis

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2016 License: MIT Imports: 5 Imported by: 0

README

Genesis

Genesis is a Go library for building stand-alone installers. It is intended as a configuration management utility for embedded systems.

Status

This is experimental software, with high API instability. However, I am currently using it in my own work.

Motivation

Traditional configuration management systems (chef, ansible, etc.) don't work well for embedded systems because they tend to assume:

  • the target is accessible by network and the network has been configured
  • the target is running an ssh server
  • supporting software has been installed (python, chef, etc).

Genesis is designed to configure a system from scratch. See the doc directory for more information.

Example

See the example directory for some examples.

Build

To build the installer, first zip up the supporting files:

zip -r files.zip files

Now build the executable:

go build my_installer.go && cat files.zip >> my_installer && zip -A my_installer

This packages the zip file into the installer binary, so that it is completely standalone. Run the binary with the -install, -status, or -remove flags to install / check status / remove.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoerHash

func DoerHash(doer Doer) string

func ExpandHome

func ExpandHome(name string) string

ExpandHome expands a leading tilde to the user's home directory.

func FileExists

func FileExists(path string) bool

FileExists is a helper function to check if a file exists.

func StringHash

func StringHash(id string) string

Types

type Doer

type Doer interface {
	Do() (bool, error)
	Undo() (bool, error)
	Status() (Status, error)
	ID() string
}

Doer can do and undo things.

type Facts

type Facts struct {
	Arch     string
	ArchType string
	OS       string
	Hostname string
	Username string
}

Facts stores discovered information about the target system.

type Module

type Module interface {
	Install() (string, error)
	Remove() (string, error)
	Status() (Status, string, error)
	Describe() string
	ID() string
}

Module is an interface for all the modules.

type Status

type Status int

Status represents a Pass/Fail/Unknown.

const (
	StatusPass Status = iota
	StatusFail
	StatusUnknown
)

Directories

Path Synopsis
example
laptop command
simple command

Jump to

Keyboard shortcuts

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