Documentation
¶
Index ¶
- Constants
- Variables
- func LoggerWithWriter() gin.HandlerFunc
- func SetGraphqlHandler(e *echo.Echo, path string, h *handler.Handler)
- func ToEchoLogFile(path string, log []byte, fileSizeLimit int64)
- func Wrapper(c client.Client) client.Client
- type Controller
- type LogEntry
- type MeanLogger
- type PageModelBase
- type ResultModel
- type SingleEntity
- type TimeWrapper
Constants ¶
View Source
const ( DREAM_SERVICE_KEY = "tech-ngs-dream" ATHENA_SERVICE_KEY = "tech-ngs-athena" )
View Source
const (
CONSUL_ADDRESSES_KEY = "CONSUL_ADDRS"
)
View Source
const LOG_CONFIG = "logconfig.ini" //用于存放当前正在写入的日志文件名
Variables ¶
View Source
var ( ServerErr = model.NewResponseError("ServerErr", -1, 200, utils.ErrorTypeInternal) RequestParamsErr = model.NewResponseError("Request parameter invalid", 999, 200, utils.ErrorTypePublic) StringConversionErr = model.NewResponseError("string conversion invalid", 999, 400, utils.ErrorTypePublic) AuthErr = model.NewResponseError("Un Auth Access", 1, 401, utils.ErrorTypePublic) InsufficientPermissionsErr = model.NewResponseError("Insufficient permissions", 2, 403, utils.ErrorTypePublic) DeviceErr = model.NewResponseError("Device Token Error", 3, 401, utils.ErrorTypePublic) ServiceErr = model.NewResponseError("Servicer error", 500, 500, utils.ErrorTypePublic) )
View Source
var ( UserNotFoundErr = model.NewResponseError("user not found", 1000, 200, utils.ErrorTypePublic) InvalidEmailAdressErr = model.NewResponseError("Invalid Email", 1001, 200, utils.ErrorTypePublic) InvalidPhoneNumberErr = model.NewResponseError("Invalid Phone Number", 1002, 200, utils.ErrorTypePublic) InvalidUserNameErr = model.NewResponseError("Invalid User name", 1003, 200, utils.ErrorTypePublic) InvalidPasswordErr = model.NewResponseError("Wrong Password", 1004, 200, utils.ErrorTypePublic) NameFormatErr = model.NewResponseError("name format error", 1005, 200, utils.ErrorTypePublic) InvalidSecretCodeErr = model.NewResponseError("secret code error", 1006, 200, utils.ErrorTypePublic) TimestampFormatErr = model.NewResponseError("time stamp format error", 1007, 200, utils.ErrorTypePublic) AuthenticationErr = model.NewResponseError("Authentication failure!", 1008, 200, utils.ErrorTypePublic) )
account
Functions ¶
func LoggerWithWriter ¶
func LoggerWithWriter() gin.HandlerFunc
Instance a Logger middleware with the specified writter buffer. Example: os.Stdout, a file opened in write mode, a socket...
func ToEchoLogFile ¶
ToEchoLogFile 将日志打印到文件
Types ¶
type Controller ¶
func NewMeanController ¶
func NewMeanController(MDBSession *mgo.Session, MDB *mgo.Database) *Controller
type MeanLogger ¶
type MeanLogger struct {
RequestID uuid.UUID
}
func NewLogger ¶
func NewLogger() *MeanLogger
func NewMeanLogger ¶
func NewMeanLogger() *MeanLogger
func (*MeanLogger) Print ¶
func (l *MeanLogger) Print(values ...interface{})
func (*MeanLogger) Println ¶
func (l *MeanLogger) Println(v ...interface{})
func (*MeanLogger) WithFields ¶
func (l *MeanLogger) WithFields(fields log.Fields) *LogEntry
type PageModelBase ¶
type PageModelBase struct {
Count int64 `json:"count,omitempty"`
PageData interface{} `json:"list,omitempty"`
}
type ResultModel ¶
type ResultModel struct {
Errors []*model.ErrorMsgDefault `json:"errors,omitempty"`
Data interface{} `json:"data,omitempty"`
}
params model that server return data and message info
func (ResultModel) Error ¶
func (p ResultModel) Error() string
type SingleEntity ¶
type TimeWrapper ¶
func (*TimeWrapper) Call ¶
func (l *TimeWrapper) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error
Click to show internal directories.
Click to hide internal directories.