core

package
v0.0.0-...-c61f402 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MarshalOptions = protojson.MarshalOptions{
	UseProtoNames:   true,
	EmitUnpopulated: true,
}

Functions

func GinHandlerFunc

func GinHandlerFunc(fn func(ctx *GinContext) error) gin.HandlerFunc

func Translate

func Translate(err error) string

Types

type GinContext

type GinContext struct {
	Context *gin.Context
}

func NewGinContext

func NewGinContext(ctx *gin.Context) *GinContext

func (*GinContext) Error

func (g *GinContext) Error(error string) error

func (*GinContext) ErrorBusiness

func (g *GinContext) ErrorBusiness(message any) error

func (*GinContext) InvalidParams

func (g *GinContext) InvalidParams(message any) error

func (*GinContext) Success

func (g *GinContext) Success(data any) error

type Response

type Response struct {
	Message string `json:"message,omitempty"`
	Data    any    `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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