commons

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheConn = errors.New("ErrCacheConn")

ErrCacheConn error type for Error Cache Connection

View Source
var ErrCacheConnResp *structs.ErrorResponse = &structs.ErrorResponse{
	Response: structs.Response{
		ResponseCode: "101002",
		ResponseDesc: structs.ResponseDesc{
			ID: cfg.GetString(fmt.Sprintf("%s%s", "response_code.ID.", "101002")),
			EN: cfg.GetString(fmt.Sprintf("%s%s", "response_code.EN.", "101002")),
		},
	},
	HttpStatus: http.StatusInternalServerError,
}

ErrCacheConnResp ErrCacheConn's response

View Source
var ErrDBConn = errors.New("ErrDBConn")

ErrDBConn error type for Error DB Connection

View Source
var ErrDBConnResp *structs.ErrorResponse = &structs.ErrorResponse{
	Response: structs.Response{
		ResponseCode: "101001",
		ResponseDesc: structs.ResponseDesc{
			ID: cfg.GetString(fmt.Sprintf("%s%s", "response_code.ID.", "101001")),
			EN: cfg.GetString(fmt.Sprintf("%s%s", "response_code.EN.", "101001")),
		},
	},
	HttpStatus: http.StatusInternalServerError,
}

ErrDBConnResp ErrDBConn's response

View Source
var ErrInfluxConn = errors.New("ErrInfluxConn")

ErrInfluxConn error type for Error Influx Connection

View Source
var ErrInfluxConnResp *structs.ErrorResponse = &structs.ErrorResponse{
	Response: structs.Response{
		ResponseCode: "101003",
		ResponseDesc: structs.ResponseDesc{
			ID: cfg.GetString(fmt.Sprintf("%s%s", "response_code.ID.", "101003")),
			EN: cfg.GetString(fmt.Sprintf("%s%s", "response_code.EN.", "101003")),
		},
	},
	HttpStatus: http.StatusInternalServerError,
}

ErrInfluxConnResp ErrInfluxConn's response

Functions

func InjectErrors

func InjectErrors(handlerCtx *phttp.HttpHandlerContext)

InjectErrors injecting all error response to the handler context

Types

type Options

type Options struct {
	Config    config.Provider
	DbMysql   *gorp.DbMap
	DbPostgre *gorp.DbMap
	CachePool *redis.Pool
	Influx    *influx.Client
	Logger    *log.Logger
}

Options common option for all object that needed

Jump to

Keyboard shortcuts

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