scurvy

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

README

scurvy

Scurvy is a thin io/log wrapper

Documentation

Overview

Package scurvy contains common utility functions.

Package scurvy contains common utility functions.

Package scurvy contains common utility functions.

Package scurvy contains common utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	IsSet(ns, key string) bool

	GetBool(ns, key string) (bool, error)
	GetInt(ns, key string) (int, error)
	GetString(ns, key string) (string, error)
	GetStringSlice(ns, key string) ([]string, error)
	GetStringMap(ns, key string) (map[string]string, error)

	SetValue(ns, key string, value interface{}) error
}

Config encapsulates a config store.

func NewConfig

func NewConfig() Config

NewConfig creates a new config store.

type PortHole

type PortHole interface {
	Trace(string, ...interface{})
	Debug(string, ...interface{})
	Info(string, ...interface{})
	Warn(string, ...interface{})
	Error(string, ...interface{})
	Fatal(string, ...interface{})
	Panic(string, ...interface{})
	GetLogLevel() string

	Magenta(string) string
	Cyan(string) string
	Red(string) string
	Yellow(string) string
	Blue(string) string
	Green(string) string
	Gray(string) string
	Bold(string) string

	IsConsoleTTY() bool
	IsConsoleColored() bool
	ConsoleWrite(string, ...interface{}) error

	Config() Config
}

PortHole encapsulates an execution context.

func NewPortHole

func NewPortHole(consoleOut, errorOut io.Writer, config Config, logLevel string, enableColors bool) PortHole

NewPortHole creates a new PortHole.

Jump to

Keyboard shortcuts

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