util

package
v0.0.0-...-db3e3ab Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitwiseOrToSliceByUint64

func BitwiseOrToSliceByUint64(n uint64) []uint64

BitwiseOrToSliceByUint64 将一个 uint64 类型的值按位或运算,返回包含相应位的切片

func BitwiseOrToUint64BySlice

func BitwiseOrToUint64BySlice(slice []uint64) uint64

BitwiseOrToUint64BySlice 对切片中的所有元素进行按位或运算

func FormatInt

func FormatInt(num int) string

func GetClientIp

func GetClientIp(ctx *gin.Context) (clientIP string)

func GetFirstLetter

func GetFirstLetter(str string) string

func GetLocalIp

func GetLocalIp() string

func JsonToStruct

func JsonToStruct()

func MapToJson

func MapToJson()

func ToJson

func ToJson(v interface{}) string

Types

type NodeItem

type NodeItem struct {
	Id     uint64
	Label  string
	Pid    uint64
	Status bool
}

type NodeList

type NodeList []NodeItem

func (NodeList) ToMap

func (l NodeList) ToMap() map[uint64]NodeItem

type NodeTree

type NodeTree struct {
	NodeItem
	Children []*NodeTree
}

func BuildTree

func BuildTree(nodes []NodeItem) []*NodeTree

func BuildValidTree

func BuildValidTree(nodes []NodeItem) []*NodeTree

func BuildValidTreeWithOption

func BuildValidTreeWithOption(nodes, validNodes NodeList) []*NodeTree

Jump to

Keyboard shortcuts

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