utils

package
v0.0.0-...-1de97f3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) bool

判断文件或者目录是否存在

func GetSize

func GetSize(content io.Seeker) (int64, error)

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(path string) bool

func WriteError

func WriteError(w http.ResponseWriter, err error) (int, error)

func WriteSuccess

func WriteSuccess(w http.ResponseWriter, path string) (int, error)

Types

type DataSet

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

进行数据集的操作处理

func NewDataSet

func NewDataSet(name string) *DataSet

func (*DataSet) Add

func (d *DataSet) Add(element interface{}) error

func (*DataSet) Clear

func (d *DataSet) Clear()

func (*DataSet) Equal

func (d *DataSet) Equal(other mapset.Set) bool

func (*DataSet) Iter

func (d *DataSet) Iter() <-chan interface{}

func (*DataSet) Num

func (d *DataSet) Num() int

集合元素数量

func (*DataSet) Remove

func (d *DataSet) Remove(element interface{}) error

func (*DataSet) Set

func (d *DataSet) Set() mapset.Set

type JsonStruct

type JsonStruct struct {
}

func NewJsonStruct

func NewJsonStruct() *JsonStruct

func (*JsonStruct) Load

func (jst *JsonStruct) Load(filename string, v interface{}) error

将内容为json格式的文件,读取并转为结构体对象

func (*JsonStruct) ParseBytes

func (jst *JsonStruct) ParseBytes(read_bytes []byte, v interface{}) (err error)

将json字符串bytes转为结构体对象

func (*JsonStruct) ParseStr

func (jst *JsonStruct) ParseStr(json_str string, v interface{}) (err error)

将json字符串str转为结构体对象

type SimpleJsonParser

type SimpleJsonParser struct {
}

func NewSimpleJsonParse

func NewSimpleJsonParse() *SimpleJsonParser

func (*SimpleJsonParser) Load

func (sjp *SimpleJsonParser) Load(filename string) ([]byte, error)

func (*SimpleJsonParser) Parse

func (sjp *SimpleJsonParser) Parse(json_datas []byte) (*simplejson.Json, error)

Jump to

Keyboard shortcuts

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