venuelib

package
v0.0.0-...-77bde16 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package venuelib provides utility functions.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(err error) codes.Code

Code returns the error code for `err` if it was produced by Venue. Otherwise, it returns codes.Unknown.

func ErrorDesc

func ErrorDesc(err error) string

ErrorDesc returns the error description of `err` if it was produced by Venue. Otherwise, it returns err.Error(), or an empty string when `err` is nil.

func Errorf

func Errorf(c codes.Code, format string, a ...interface{}) error

Errorf returns an error containing an error code and a description. Errorf returns nil if `c` is OK.

func FnName

func FnName() string

FnName returns the calling function name, e.g. "SomeFunction()". This is useful for logging the function name with glog.

Example
if glog.V(3) {
	glog.Info(FnName())
}
Output:

func FnNameWithArgs

func FnNameWithArgs(args ...string) string

FnNameWithArgs returns the calling function name, with argument values, e.g. "SomeFunction(arg1, arg2)". This is useful for logging function calls with glog.

func GetPasswd

func GetPasswd() (string, error)

GetPasswd requests the user for a masked password.

func ToInt

func ToInt(s string) int

ToInt converts a string to an int.

Types

This section is empty.

Jump to

Keyboard shortcuts

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