utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ginrus

func Ginrus(logger loggerEntryWithFields, timeFormat string, utc bool) gin.HandlerFunc

Ginrus returns a gin.HandlerFunc (middleware) that logs requests using logrus.

Requests with error are logged using logrus.Error(). Requests without error are logged using logrus.Info().

It receives:

  1. A time package format string (e.g. time.RFC3339).
  2. A boolean stating whether to use UTC time zone or local.

func NotImplemented

func NotImplemented(c *gin.Context)

func QuickReply

func QuickReply(c *gin.Context, code errors.Code, message string, args ...interface{})

func QuickReplyError

func QuickReplyError(c *gin.Context, err error)

Types

type CommonResponse

type CommonResponse struct {
	// in: body
	Body struct {
		Code    int64  `json:"code"`
		Message string `json:"message"`
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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