core

package
v0.0.0-...-a35a875 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

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 IsDevEnv

func IsDevEnv() bool

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

Directories

Path Synopsis
agent

Jump to

Keyboard shortcuts

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