metrics

package
v0.0.0-...-5fa8bf8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescDump

func DescDump(d Desc) []byte

func DescMarshal

func DescMarshal(d Desc) []byte

func DescPrintJson

func DescPrintJson(d Desc) string

Types

type Desc

type Desc struct {
	Name  string     `json:"name"`
	Desc  string     `json:"desc"`
	Elems []DescElem `json:"elems"`
}

type DescBuilder

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

DescBuilder 构建器结构体。方便构造。

func NewDescBuilder

func NewDescBuilder(name string, desc string) *DescBuilder

NewDescBuilder 创建一个新的 DescBuilder 实例

func (*DescBuilder) AddElem

func (builder *DescBuilder) AddElem(name string, desc string, val interface{}) *DescBuilder

AddElem 向描述中添加元素

func (*DescBuilder) GetDesc

func (builder *DescBuilder) GetDesc() Desc

GetDesc 获取构建好的描述

type DescElem

type DescElem struct {
	Name string      `json:"name"`
	Desc string      `json:"desc"`
	Val  interface{} `json:"val"`
}

这是Desc的组成元素。

type DescHead

type DescHead struct {
	Name string `json:"name"`
	Desc string `json:"desc"`
}

Jump to

Keyboard shortcuts

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