internal

package
v0.0.0-...-72bdc65 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotImplementedError = errors.New("not implemented yet")

Functions

func GetTLSConfig

func GetTLSConfig(
	SSLCert, SSLKey, SSLCA string,
	InsecureSkipVerify bool,
) (*tls.Config, error)

GetTLSConfig gets a tls.Config object from the given certs, key, and CA files. you must give the full path to the files. If all files are blank and InsecureSkipVerify=false, returns a nil pointer.

func Glob

func Glob(pattern, measurement string) bool

Glob will test a string pattern, potentially containing globs, against a subject string. The result is a simple true/false, determining whether or not the glob pattern matched the subject text.

Adapted from https://github.com/ryanuber/go-glob/blob/master/glob.go thanks Ryan Uber!

func RandomString

func RandomString(n int) string

RandomString returns a random string of alpha-numeric characters

func ReadLines

func ReadLines(filename string) ([]string, error)

ReadLines reads contents from a file and splits them by new lines. A convenience wrapper to ReadLinesOffsetN(filename, 0, -1).

func ReadLinesOffsetN

func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error)

ReadLines reads contents from file and splits them by new line. The offset tells at which line number to start. The count determines the number of lines to read (starting from offset):

n >= 0: at most n lines
n < 0: whole file

Types

type Duration

type Duration struct {
	Duration time.Duration
}

Duration just wraps time.Duration

func (*Duration) UnmarshalTOML

func (d *Duration) UnmarshalTOML(b []byte) error

UnmarshalTOML parses the duration from the TOML config file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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