Documentation
¶
Index ¶
Constants ¶
View Source
const DEFAULT_OVERRIDE_CONFIG_NAME = "override"
View Source
const DEFAULT_PROJECT_ROOT = "oj-lab-services"
View Source
const OVERRIDE_CONFIG_NAME_ENV_KEY = "OJ_LAB_OVERRIDE_CONFIG_NAME"
View Source
const PROJECT_ROOT_ENV_KEY = "OJ_LAB_PROJECT_ROOT"
View Source
const SERVICE_ENV_KEY = "OJ_LAB_SERVICE_ENV"
Variables ¶
View Source
var AppConfig *viper.Viper
Functions ¶
func GetProjectRoot ¶
func GetProjectRoot() string
func IsServiceError ¶
func IsServiceError(err interface{}) bool
Types ¶
type ServiceEnv ¶
type ServiceEnv string
const ( DEV_SERVICE_ENV ServiceEnv = "development" PRD_SERVICE_ENV ServiceEnv = "production" )
type SeviceError ¶
type SeviceError struct { Code int `json:"code"` Msg string `json:"msg"` // contains filtered or unexported fields }
func NewInternalError ¶
func NewInternalError(msg string) *SeviceError
func NewInvalidParamError ¶
func NewInvalidParamError(param string, hints ...string) *SeviceError
func NewUnauthorizedError ¶
func NewUnauthorizedError(msg string) *SeviceError
func (*SeviceError) AppendToGin ¶
func (se *SeviceError) AppendToGin(ginCtx *gin.Context)
func (*SeviceError) CaptureStackTrace ¶
func (se *SeviceError) CaptureStackTrace() *SeviceError
func (*SeviceError) ToGinError ¶
func (se *SeviceError) ToGinError() *gin.Error
Click to show internal directories.
Click to hide internal directories.