示例#1
0
func main() {
	p := pager.NewUrlPager(10, 1, nil)
	fmt.Println(p.PagerString())
	fmt.Println("--------------------------")

	p = pager.NewUrlPager(0, 0, nil)
	fmt.Println(p.PagerString())
	fmt.Println("--------------------------")
	p = pager.NewUrlPager(10, 10, nil)
	fmt.Println(p.PagerString())

	fmt.Println("--------------------------")
	p = pager.NewUrlPager(10, 9, nil)
	fmt.Println(p.PagerString())

	return

	context := glob.NewContext()
	goclient.Configure("tcp", ":"+context.Config().GetString(variable.SocketPort), context)
	context.DebugMode = true
	jsv.Configure(context)

	//fmt.Println(ording.NewSecret(101))

	go testRegister()
	go testPartner()
	go testSubmitOrder()

	testMemberLogin()
	for {
		time.Sleep(10 * time.Second)
		go testMemberLogin()
	}
}
示例#2
0
文件: client.go 项目: jacobxk/go2o
func Configure(net, addr string, c gof.App) {
	var err error
	_conn, err = jsv.Dial(net, addr)

	if err != nil {
		fmt.Println("[TCP]: Connect Refused,", addr)
		os.Exit(1)
	}

	jsv.Configure(c)
	Member = &memberClient{conn: _conn}
	Partner = &partnerClient{conn: _conn}
	Redirect = &redirectClient{conn: _conn}
}