Last active
February 12, 2017 23:54
-
-
Save monopolly/81c0dd092580d8b4c2e21fecd80a8e4f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/tarantool/go-tarantool" | |
"gopkg.in/vmihailenco/msgpack.v2" | |
) | |
type AccountExample struct { | |
//magic here | |
_msgpack struct{} `msgpack:",asArray"` | |
ID string `json:"id,omitempty" msgpack:"id,omitempty"` | |
Email string `json:"key,omitempty" msgpack:"key,omitempty"` | |
Password string `json:"token,omitempty" msgpack:"token,omitempty"` | |
Params map[string]interface{} `json:"params,omitempty" msgpack:"params,omitempty"` | |
Date uint64 `json:"date,omitempty" msgpack:"date,omitempty"` | |
Verified bool `json:"verified" msgpack:"verified"` | |
} | |
func main() { | |
// establish connection ... | |
var accounts [1]AccountExample | |
err = conn.SelectTyped(spaceNo, indexNo, 1, 1, IterEq, []interface{}{"[email protected]", "12345"}, &accounts) | |
if err != nil { | |
t.Errorf("Failed to SelectTyped: %s", err.Error()) | |
return | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment