Skip to content

Commit 6e2c73d

Browse files
Simplify box creation
Co-authored-by: Oleg Jukovec <oleg.jukovec@gmail.com>
1 parent f21a2c4 commit 6e2c73d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

box/box.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,15 @@ import (
44
"github.com/tarantool/go-tarantool/v2"
55
)
66

7-
// Box defines an interface for interacting with a Tarantool instance.
8-
// It includes the Info method, which retrieves instance information.
9-
type Box interface {
10-
Info() (Info, error) // Retrieves detailed information about the Tarantool instance.
11-
}
12-
13-
// box is a concrete implementation of the Box interface.
7+
// Box is a helper that wraps for box.* requests.
148
// It holds a connection to the Tarantool instance via the Doer interface.
15-
type box struct {
9+
type Box struct {
1610
conn tarantool.Doer // Connection interface for interacting with Tarantool.
1711
}
1812

1913
// By returns a new instance of the box structure, which implements the Box interface.
20-
func By(conn tarantool.Doer) Box {
21-
return &box{
14+
func New(conn tarantool.Doer) Box {
15+
return &Box{
2216
conn: conn, // Assigns the provided Tarantool connection.
2317
}
2418
}

0 commit comments

Comments
 (0)