datarw

package
v0.0.0-...-d5cdf10 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GobEncodeOrDecode

func GobEncodeOrDecode()

func GobFile

func GobFile()

func GobFileToObj

func GobFileToObj(filename string, obj interface{}) error

func JSONToObj

func JSONToObj()

JSONToObj 反序列化

func ObjToGobFile

func ObjToGobFile(filename string, obj interface{}) error

func ObjToJSON

func ObjToJSON()

ObjToJSON 序列化Json

func ReadFile

func ReadFile()

func ReadGzipFile

func ReadGzipFile()

func ReadProducts

func ReadProducts()

old way

func ReadProducts2

func ReadProducts2()

new way

func ReadXml

func ReadXml()

go默认的xml解析器是SAX解析

func Save

func Save(page Page) error

Save page

func SaveLoadPage

func SaveLoadPage()

SaveLoadPage test

func StartArgs

func StartArgs()

Types

type Address

type Address struct {
	Type    string
	City    string
	Country string
}

type P

type P struct {
	X, Y, Z int
	Name    string
}

gob类似于Java中的Serialization,用于序列化对象,可用于RPC调用中

type Page

type Page struct {
	Title string
	Body  []byte
}

Page page

func Load

func Load(title string) (*Page, error)

Load page

type Product

type Product struct {
	Title    string
	Price    float64
	Quantity int
}

type Q

type Q struct {
	X, Y *int32
	Name string
}

type VCard

type VCard struct {
	FirstName string
	LastName  string
	Addresses []*Address
	Remark    string
}

Jump to

Keyboard shortcuts

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