common

package
v0.0.0-...-45f22e2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MODE_SYSLOG  = "SYSLOG"
	MODE_CONSOLE = "STDOUT"
)

Variables

View Source
var (
	Config  Configuration
	EOS_URL string
)

Functions

func ConfigInit

func ConfigInit(file *os.File)

func ErrorLog

func ErrorLog(logger zerolog.Logger, method string, appErr *errors.AppError, message string)

func ErrorLogWithParams

func ErrorLogWithParams(logger zerolog.Logger, method string,
	appErr *errors.AppError, message string, params map[string]string)

func Errorf

func Errorf(logger zerolog.Logger, r *http.Request, w http.ResponseWriter, code int, format string, error error, appErr *errors.AppError, a ...interface{})

errorf writes a swagger-compliant error response.

func ErrorfWithParams

func ErrorfWithParams(logger zerolog.Logger, r *http.Request, w http.ResponseWriter, code int, format string, error error, appErr *errors.AppError, params map[string]string, a ...interface{})

errorf writes a swagger-compliant error response.

func HTTPErrorLog

func HTTPErrorLog(logger zerolog.Logger, r *http.Request, code int, content string, message string, err error, appErr *errors.AppError)

func HTTPErrorLogWithParams

func HTTPErrorLogWithParams(logger zerolog.Logger, r *http.Request, code int, content string, message string, err error, appErr *errors.AppError, params map[string]string)

func HTTPRequestLog

func HTTPRequestLog(logger zerolog.Logger, r *http.Request, message string)

func HTTPRequestWithParamsLog

func HTTPRequestWithParamsLog(logger zerolog.Logger, r *http.Request, message string, params map[string]string)

func HTTPResponseLog

func HTTPResponseLog(logger zerolog.Logger, r *http.Request, code int, contentType string, content string, message string)

func InfoLog

func InfoLog(logger zerolog.Logger, method string, message string)

func InfoLogWithParams

func InfoLogWithParams(logger zerolog.Logger, method string,
	message string, params map[string]string)

func Logger

func Logger(module string, context context.Context) zerolog.Logger

func LoggerInit

func LoggerInit(level string)

func ToolsAccountGenerateName

func ToolsAccountGenerateName(fiveCharsMaxPrefix string) string

generate an EOS compliant account name length < 12 charset: a..z12345

func ToolsWalletGenerateName

func ToolsWalletGenerateName(prefix string) string

Types

type Configuration

type Configuration struct {
	NODE_PRODUCER_NAME           string
	NODE_PUB_KEY                 string
	ENV_EOS_SRC_PATH             string
	ENV_EOSGO_PATH               string
	API_PORT                     int
	API_URL                      string
	API_METHOD                   string
	LOGGING_MODE                 string
	WALLET_NAME                  string
	WALLET_PRIV_KEY              string
	TRANSACTION_EXPIRATION_DELAY int
}

Jump to

Keyboard shortcuts

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