 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
const ( TCPNetwork = "tcp" UnixNetwork = "unix" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryConnector ¶
type BinaryConnector struct {
	// contains filtered or unexported fields
}
    BinaryConnector implements Connector interface for a connection that sends and receives data via IPROTO.
func NewBinaryConnector ¶
func NewBinaryConnector(conn tarantool.Connector) *BinaryConnector
NewBinaryConnector creates a new BinaryConnector object. The object will close the tarantool.Connector argument in Close() call.
func (*BinaryConnector) Close ¶
func (conn *BinaryConnector) Close() error
Close closes the tarantool.Connector created from.
func (*BinaryConnector) Eval ¶
func (conn *BinaryConnector) Eval(expr string, args []interface{}, opts RequestOpts) ([]interface{}, error)
Eval sends an eval request.
type ConnectOpts ¶
type ConnectOpts struct {
	// Network is a characteristic of a connection like "type" ("tcp" and
	// "unix" are used).
	Network string
	// Address of an instance.
	Address string
	// Username of the tarantool user.
	Username string
	// Password of the user.
	Password string
	// Ssl options for a connection.
	Ssl SslOpts
}
    ConnectOpts describes options for a connection to a tarantool instance.
func MakeConnectOpts ¶
func MakeConnectOpts(connString, username, password string, ssl SslOpts) ConnectOpts
MakeConnectOpts creates a new connection options object according to the arguments passed. An username and a password values from the connection string are used only if the username and password from the arguments are empty.
type Connector ¶
Connector is an interface that wraps all method required for a connector.
func Connect ¶
func Connect(opts ConnectOpts) (Connector, error)
Connect connects to the tarantool instance according to options.
type EvalPlainTextOpts ¶
type Evaler ¶
type Evaler interface {
	// Eval passes Lua expression for evaluation.
	Eval(expr string, args []interface{}, opts RequestOpts) ([]interface{}, error)
}
    Eval is an interface that wraps Eval method.
type PlainTextEvalRes ¶
type PlainTextEvalRes struct {
	DataEncBase64 string `yaml:"data_enc"`
}
    type Protocol ¶
type Protocol int
Protocol defines a set of supported protocols for a connect.
func GetProtocol ¶
GetProtocol gets a protocol name from the reader greeting. See: https://github.com/tarantool/tarantool/blob/8dcefeb2bf5291487496d168cb81f5b6082a2af0/test/unit/xrow.cc#L92-L123
func ParseProtocol ¶
ParseProtocol parses a protocol name from a Tarantool greeting.
type RequestOpts ¶
type RequestOpts struct {
	// PushCallback is the cb that will be called when a "push" message is received.
	PushCallback func(interface{})
	// ReadTimeout timeout for the operation.
	ReadTimeout time.Duration
	// ResData describes the typed result of the operation executed.
	ResData interface{}
}
    RequestOpts describes the parameters of a request to be executed.
type SslOpts ¶ added in v1.0.0
type SslOpts struct {
	// KeyFile is a path to a private SSL key file.
	KeyFile string
	// CertFile is a path to an SSL certificate file.
	CertFile string
	// CaFile is a path to a trusted certificate authorities (CA) file.
	CaFile string
	// Ciphers is a colon-separated (:) list of SSL cipher suites the
	// connection can use.
	Ciphers string
}
    SslOpts is a way to configure SSL connection.
type TextConnector ¶
type TextConnector struct {
	// contains filtered or unexported fields
}
    TextConnector implements Connector interface for a connection that sends and receives data as a plain text.
func NewTextConnector ¶
func NewTextConnector(conn net.Conn) *TextConnector
NewTextConnector creates a new TextConnector object. The object will close the net.Conn argument in Close() call.
func (*TextConnector) Close ¶
func (conn *TextConnector) Close() error
Close closes the net.Conn created from.
func (*TextConnector) Eval ¶
func (conn *TextConnector) Eval(expr string, args []interface{}, opts RequestOpts) ([]interface{}, error)
Eval sends an eval request.