utils

package
v1.10.13-0...-5e65d5e Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoggerService = &Logger{
	newColor: color.New,
}

LoggerService is the default logger instance

Functions

func FormatNumber

func FormatNumber(n string) string

FormatNumber formats a phone number to remove unnecessary chars and avoid dealing with unwanted input.

func IsValid

func IsValid(number string) bool

IsValid indicate if a phone number has a valid format.

func ParseCountryCode

func ParseCountryCode(n string) string

ParseCountryCode parses a phone number and returns ISO country code. This is required in order to use the phonenumbers library.

Types

type Logger

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

Logger allows you to log messages in the terminal

func (*Logger) Errorln

func (l *Logger) Errorln(s ...string)

Errorln logs an error message

func (*Logger) Infoln

func (l *Logger) Infoln(s ...string)

Infoln logs an info message

func (*Logger) Successf

func (l *Logger) Successf(format string, messages ...interface{})

Successf logs a success message

func (*Logger) Successln

func (l *Logger) Successln(s ...string)

Successln logs a success message

func (*Logger) Warnln

func (l *Logger) Warnln(s ...string)

Warnln logs an warning message

Jump to

Keyboard shortcuts

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