cmdutils

package
v0.0.0-...-1a3f41a Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ERR_EXT is the error extension tacked onto scopes
	ERR_EXT = "-err"

	// LN_FMT is the formatting of each log
	LN_FMT = "%-35s %s"
)

Functions

func BuildDate

func BuildDate(timestamp string) string

BuildDate returns a string representing build date

func Lapsed

func Lapsed(timestamp string) string

Lapsed retrieves the time lapsed since timestamp date

func SplitBySpaces

func SplitBySpaces(s string) []string

SplitBySpaces returns a string slice of words in s

Types

type Config

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

Config is the store for config data

func NewConfig

func NewConfig() Config

NewConfig will get all environment variables and set defaults

func (Config) Get

func (c Config) Get(key string) string

Get will retrieve a config setting

type LogMeta

type LogMeta struct {
	Tags tagMap  `json:"-"`
	Data dataMap `json:"data"`
}

type Logger

type Logger interface {
	EnableAggregation(string)
	KV(string, interface{}) Logger
	Tag(string, string)
	Log(string) Logger
	Error(error) Logger
	Fatal(error)
}

Logger is the logging interface

func NewLogger

func NewLogger(scope string) Logger

NewLogger returns a new Logger interface

type SlackAttachment

type SlackAttachment struct {
	Title     string `json:"title"`
	TitleLink string `json:"title_link"`
	Text      string `json:"text"`
}

SlackAttachment is optionally attached to SlackResponses

type SlackResponse

type SlackResponse struct {
	ResponseType string            `json:"response_type"`
	Text         string            `json:"text"`
	Attachments  []SlackAttachment `json:"attachments"`
}

SlackResponse is the response returned as JSON

Jump to

Keyboard shortcuts

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