util

package
v0.0.0-...-3fa228a Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppFs = afero.NewOsFs()

AppFs is an aero filesystem. It is stored in a variable so that we can replace it with in-memory filesystems for unit tests.

Functions

func EditDistance

func EditDistance(a, b []string) int

EditDistance returns the number of strings that are in exclusively `a` or `b`.

func MyIP

func MyIP() (string, error)

MyIP gets the local systems Public IP address as visible on the WAN by querying an exeternal service.

func Open

func Open(path string) (afero.File, error)

Open opens a new aero file.

func ShortUUID

func ShortUUID(uuid string) string

ShortUUID truncates a uuid string to 12 characters.

func StrSliceEqual

func StrSliceEqual(x, y []string) bool

StrSliceEqual returns true of the string slices 'x' and 'y' are identical.

func StrStrMapEqual

func StrStrMapEqual(x, y map[string]string) bool

StrStrMapEqual returns true of the string->string maps 'x' and 'y' are equal.

func ToTar

func ToTar(name string, permissions int, content string) (io.Reader, error)

ToTar returns a tar archive named NAME and containing CONTENT.

func WriteFile

func WriteFile(filename string, data []byte, perm os.FileMode) error

WriteFile writes 'data' to the file 'filename' with the given permissions.

Types

type Formatter

type Formatter struct{}

Formatter implements the log formatter for Quilt.

func (Formatter) Format

func (f Formatter) Format(entry *log.Entry) ([]byte, error)

Format converts a logrus entry into a string for logging.

Jump to

Keyboard shortcuts

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