示例#1
0
func main() {
	configs := []*gsm.Config{
		&gsm.Config{
			Host: "127.0.0.1",
			Port: 1024,
			Data: []string{"TestA"},
		},

		&gsm.Config{
			Host: "127.0.0.1",
			Port: 1025,
			Data: []string{"TestB"},
		},
	}

	gsm.Init(configs...)
	var ta TestA
	var tb TestB
	ta.Save()
	tb.Save()
	ta.Get()
	tb.Get()

	gsm.Close()
}
示例#2
0
文件: test.go 项目: Wuyue/Gsm
func main() {
	gsm.Init(&gsm.Config{Host: "127.0.0.1", Port: 1024, Data: []string{"Test"}})
	var t Test
	t.Save()
	t.Get()
	t.FindAll()
	t.Delete()
	gsm.Close()
}