utils

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package utils contains all the utility functions used by nephele

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorString added in v0.5.0

func ColorString(str string) string

ColorString wraps the provided string with appropriate color according to its state and returns the colored string. It should be used only for highlighting instance states and not recommended for any other purpose.

func GetProgressBar added in v0.2.0

func GetProgressBar(totalSize int) *pb.ProgressBar

GetProgressBar returns an instance of ProgressBar with predefined config.

func WordWrap added in v0.2.1

func WordWrap(s string, sep byte, parts int) string

WordWrap wraps the given string according to the provided parts with the separator sep and returns the wrapped string if and only if the given string has the character `.` or `-`. Currently WordWrap is very naive and it'll break the string if the separator position is greater than the half length of the provided string. It has been written solely for the purpose of wrapping text for rendering in table writer and not recommended for normal use.

Types

This section is empty.

Jump to

Keyboard shortcuts

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