utils

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsMiddleware

func CorsMiddleware() gin.HandlerFunc

func D

func D(a string) decimal.Decimal

func Float2String

func Float2String(f float64, toFix int) string

func FormatDecimal

func FormatDecimal(d string, digit int) string

func Hash256

func Hash256(data any) string

func NumberFix

func NumberFix(a string, toFix int) string

func ResponseFailJson

func ResponseFailJson(ctx *gin.Context, reason string)

func ResponseOkJson

func ResponseOkJson(ctx *gin.Context, data any)

func S2F64

func S2F64(a string) float64

func S2Int

func S2Int(a string) int

func S2Int64

func S2Int64(a string) int64

Types

type DeciStr

type DeciStr string

func (DeciStr) Decimal

func (t DeciStr) Decimal() decimal.Decimal

func (DeciStr) MarshalJSON

func (t DeciStr) MarshalJSON() ([]byte, error)

func (DeciStr) String

func (t DeciStr) String() string

type Time

type Time time.Time

func (Time) Format

func (t Time) Format() string

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (Time) Unix

func (t Time) Unix() int64

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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