utils

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateService

func CreateService(name string) micro.Service

CreateService is used to create a service defination

func GatewayRespond

func GatewayRespond(
	w http.ResponseWriter, data map[string]string, msg string, err error, log *zap.Logger)

GatewayRespond is used to respond to client with json data

func GetMockUserData

func GetMockUserData() (config.UserMain, config.UserExtra)

GetMockUserData returns mock user data for testing

func HandlePanic

func HandlePanic(log *zap.Logger)

HandlePanic is used to handle panic when it occurs in a microservice

func UnmarshalMap

func UnmarshalMap(data map[string]interface{}, toValue interface{})

UnmarshalMap is used to convert map[string]interface{} to a struct

Types

This section is empty.

Jump to

Keyboard shortcuts

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