utils

package
v0.0.0-...-e7b8ae0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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