示例#1
0
func NewRemoteAppConn(addr string) (*remoteAppConn, error) {
	client, err := tmspcli.NewClient(addr, false)
	if err != nil {
		return nil, err
	}
	appConn := &remoteAppConn{
		Client: client,
	}
	return appConn, nil
}
示例#2
0
// 'addr': if "local", will start an embedded one.
func NewClient(addr, tmsp string) (*Client, error) {
	if addr == "local" {
		return NewLocalClient(), nil
	}
	tmspClient, err := tmspcli.NewClient(addr, tmsp, false)
	if err != nil {
		return nil, err
	}
	client := &Client{
		Client: tmspClient,
	}
	return client, nil
}