core

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package core contains basic utility functions.

Index

Constants

View Source
const (
	Name    = "bettercap"
	Version = "2.0.0"
	Author  = "Simone 'evilsocket' Margaritelli"
	Website = "https://bettercap.org/"
)
View Source
const (
	DEBUG = iota
	INFO
	IMPORTANT
	WARNING
	ERROR
	FATAL
)
View Source
const (
	AlignLeft   = Alignment(0)
	AlignCenter = Alignment(1)
	AlignRight  = Alignment(2)
)

Variables

View Source
var (
	BOLD = "\033[1m"
	DIM  = "\033[2m"

	RED    = "\033[31m"
	GREEN  = "\033[32m"
	BLUE   = "\033[34m"
	YELLOW = "\033[33m"

	FG_BLACK = "\033[30m"
	FG_WHITE = "\033[97m"

	BG_DGRAY  = "\033[100m"
	BG_RED    = "\033[41m"
	BG_GREEN  = "\033[42m"
	BG_YELLOW = "\033[43m"
	BG_LBLUE  = "\033[104m"

	RESET = "\033[0m"

	NoColors = false
)

https://misc.flogisoft.com/bash/tip_colors_and_formatting

View Source
var (
	LogLabels = map[int]string{
		DEBUG:     "dbg",
		INFO:      "inf",
		IMPORTANT: "imp",
		WARNING:   "war",
		ERROR:     "err",
		FATAL:     "!!!",
	}
	LogColors = map[int]string{
		DEBUG:     DIM + FG_BLACK + BG_DGRAY,
		INFO:      FG_WHITE + BG_GREEN,
		IMPORTANT: FG_WHITE + BG_LBLUE,
		WARNING:   FG_WHITE + BG_YELLOW,
		ERROR:     FG_WHITE + BG_RED,
		FATAL:     FG_WHITE + BG_RED + BOLD,
	}
)

Functions

func AsTable

func AsTable(w io.Writer, columns []string, rows [][]string)

func Blue

func Blue(s string) string

func Bold

func Bold(s string) string

func Dim

func Dim(s string) string

func Exec

func Exec(executable string, args []string) (string, error)

func Exists

func Exists(path string) bool

func ExpandPath

func ExpandPath(path string) (string, error)

func Green

func Green(s string) string

func Red

func Red(s string) string

func Shell

func Shell(cmd string) (string, error)

func Trim

func Trim(s string) string

func TrimRight

func TrimRight(s string) string

func UniqueInts

func UniqueInts(a []int, sorted bool) []int

func W

func W(e, s string) string

W for Wrap

func Yellow

func Yellow(s string) string

Types

type Alignment

type Alignment int

type Options

type Options struct {
	InterfaceName *string
	Caplet        *string
	Debug         *bool
	Silent        *bool
	NoHistory     *bool
	EnvFile       *string
	Commands      *string
	CpuProfile    *string
	MemProfile    *string
}

func ParseOptions

func ParseOptions() (Options, error)

Jump to

Keyboard shortcuts

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