uuid

package
v2.0.0-...-2a4499d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2023 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package with support of Tarantool's UUID data type.

UUID data type supported in Tarantool since 2.4.1.

Since: 1.6.0.

See also

Example

Example demonstrates how to use tuples with UUID. To enable UUID support in msgpack with google/uuid (https://github.com/google/uuid), import tarantool/uuid submodule.

opts := tarantool.Opts{
	User: "test",
	Pass: "test",
}
client, err := tarantool.Connect("127.0.0.1:3013", opts)
if err != nil {
	log.Fatalf("Failed to connect: %s", err.Error())
}

spaceNo := uint32(524)

id, uuidErr := uuid.Parse("c8f0fa1f-da29-438c-a040-393f1126ad39")
if uuidErr != nil {
	log.Fatalf("Failed to prepare uuid: %s", uuidErr)
}

resp, err := client.Do(tarantool.NewReplaceRequest(spaceNo).
	Tuple([]interface{}{id}),
).Get()

fmt.Println("UUID tuple replace")
fmt.Println("Error", err)
fmt.Println("Code", resp.Code)
fmt.Println("Data", resp.Data)
Output:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL