Skip to content

Instantly share code, notes, and snippets.

@monopolly
Last active February 12, 2017 23:54
Show Gist options
  • Save monopolly/81c0dd092580d8b4c2e21fecd80a8e4f to your computer and use it in GitHub Desktop.
Save monopolly/81c0dd092580d8b4c2e21fecd80a8e4f to your computer and use it in GitHub Desktop.
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{}{"test@mail.com", "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