utils

package
v1.1.37 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AudioUtil audioUtil
View Source
var ReflectUtil reflectUtil
View Source
var StringUtil stringUtil
View Source
var StructUtil structUtil
View Source
var TextUtil textUtil

Functions

func CommandRun

func CommandRun(command string, args []string) (string, error)

func NewRequestBuilder

func NewRequestBuilder[T any]() *requestBuilder[T]

func ResponseApiError

func ResponseApiError(c igin.IContext, statusCode int, msg string, err interface{})

func ResponseApiOk

func ResponseApiOk(c igin.IContext, msg string, data interface{})

func SliceToSlice

func SliceToSlice[T any, U any](from []T, to *[]U) error

Types

type ApiResponse

type ApiResponse struct {
	Success bool        `json:"success"`
	Code    int         `json:"code"`
	Msg     string      `json:"msg"`
	Data    interface{} `json:"data,omitempty"`
}

type PaginationResult

type PaginationResult struct {
	Records []interface{} `json:"records"`
	Current int           `json:"current"`
	Size    int           `json:"size"`
	Total   int           `json:"total"`
	Pages   int           `json:"pages"`
}

type Snowflake

type Snowflake struct {
	// contains filtered or unexported fields
}

func NewSnowflake

func NewSnowflake(machineID int64) *Snowflake

func (*Snowflake) NextID

func (sf *Snowflake) NextID() int64

Jump to

Keyboard shortcuts

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