Documentation
¶
Overview ¶
Example ¶
dialer := tarantool.NetDialer{ Address: "127.0.0.1:3013", User: "test", Password: "test", } ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) client, err := tarantool.Connect(ctx, dialer, tarantool.Opts{}) cancel() if err != nil { log.Fatalf("Failed to connect: %s", err) } // You can use Info Request type. fut := client.Do(box.NewInfoRequest()) resp := &box.InfoResponse{} err = fut.GetTyped(resp) if err != nil { log.Fatalf("Failed get box info: %s", err) } // Or use simple Box implementation. b := box.New(client) info, err := b.Info() if err != nil { log.Fatalf("Failed get box info: %s", err) } if info.UUID != resp.Info.UUID { log.Fatalf("Box info uuids are not equal") } fmt.Printf("Box info uuids are equal") fmt.Printf("Current box info: %+v\n", resp.Info)
Index ¶
- type Box
- type Info
- type InfoRequest
- func (req InfoRequest) Async() bool
- func (i InfoRequest) Body(res tarantool.SchemaResolver, enc *msgpack.Encoder) error
- func (req InfoRequest) Ctx() context.Context
- func (req InfoRequest) Response(header tarantool.Header, body io.Reader) (tarantool.Response, error)
- func (req InfoRequest) Type() iproto.Type
- type InfoResponse
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
Box is a helper that wraps box.* requests. It holds a connection to the Tarantool instance via the Doer interface.
type Info ¶
type Info struct { // The Version of the Tarantool instance. Version string `msgpack:"version"` // The node ID (nullable). ID *int `msgpack:"id"` // Read-only (RO) status of the instance. RO bool `msgpack:"ro"` // UUID - Unique identifier of the instance. UUID string `msgpack:"uuid"` // Process ID of the instance. PID int `msgpack:"pid"` // Status - Current status of the instance (e.g., running, unconfigured). Status string `msgpack:"status"` // LSN - Log sequence number of the instance. LSN uint64 `msgpack:"lsn"` }
Info represents detailed information about the Tarantool instance. It includes version, node ID, read-only status, process ID, cluster information, and more.
type InfoRequest ¶
type InfoRequest struct {
// contains filtered or unexported fields
}
InfoRequest represents a request to retrieve information about the Tarantool instance. It implements the tarantool.Request interface.
func NewInfoRequest ¶
func NewInfoRequest() InfoRequest
NewInfoRequest returns a new empty info request.
func (InfoRequest) Async ¶
func (req InfoRequest) Async() bool
Async returns request expects a response.
func (InfoRequest) Body ¶
func (i InfoRequest) Body(res tarantool.SchemaResolver, enc *msgpack.Encoder) error
Body method is used to serialize the request's body. It is part of the tarantool.Request interface implementation.
type InfoResponse ¶
type InfoResponse struct {
Info Info
}
InfoResponse represents the response structure that holds the information of the Tarantool instance. It contains a single field: Info, which holds the instance details (version, UUID, PID, etc.).
func (*InfoResponse) DecodeMsgpack ¶
func (ir *InfoResponse) DecodeMsgpack(d *msgpack.Decoder) error