os

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

存取值用的键值对象 等同于Java中的HashMap 或 C#中的Dictionary对象。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EJson

type EJson struct {
	Json *gabs.Container
}

func NewJson

func NewJson() *EJson

func New存取键值表

func New存取键值表() *EJson

func (*EJson) Clear

func (this *EJson) Clear() *EJson

func (*EJson) Data

func (this *EJson) Data() interface{}

func (*EJson) Del

func (this *EJson) Del(key string) error

func (*EJson) E删除

func (this *EJson) E删除(key string) error

func (*EJson) E到JSON

func (this *EJson) E到JSON(是否修饰 bool) string

func (*EJson) E取值

func (this *EJson) E取值(key string) int64

func (*EJson) E取文本

func (this *EJson) E取文本(key string) string

func (*EJson) E取逻辑值

func (this *EJson) E取逻辑值(key string) bool

func (*EJson) GetArrayAllData

func (this *EJson) GetArrayAllData(s string) []*gabs.Container

GetArrayAllData 获取某个数组里面的所有数据

for i, object := range v.GetArrayAllData("array.list") {
	fmt.Printf("i:%s value:%s \n", i, object.Path("avg").Data().(string))
	fmt.Printf("i:%s value:%s \n", i, object.Path("avg").ToString())
	fmt.Printf("i:%s value:%s \n", i, object.Path("avg").ToInt())
	fmt.Printf("i:%s value:%s \n", i, object.GetString("avg"))
}

func (*EJson) GetArrayCount

func (this *EJson) GetArrayCount(s string) int

func (*EJson) GetBool

func (this *EJson) GetBool(key string) bool

func (*EJson) GetInt

func (this *EJson) GetInt(key string) int64

func (*EJson) GetString

func (this *EJson) GetString(key string) string

func (*EJson) Init

func (this *EJson) Init() *EJson

func (*EJson) LoadFromJsonFile

func (this *EJson) LoadFromJsonFile(filepath string) bool

func (*EJson) LoadFromJsonString

func (this *EJson) LoadFromJsonString(data string) bool

func (*EJson) Set

func (this *EJson) Set(key string, value interface{})

func (*EJson) SetArray

func (this *EJson) SetArray(key string, value interface{})

func (*EJson) ToJson

func (this *EJson) ToJson(是否修饰 bool) string

type H

type H map[string]interface{}

Jump to

Keyboard shortcuts

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