Documentation ¶
Index ¶
- Constants
- Variables
- func AddStmtPart(stmt, part string, validator Validator) (string, bool)
- func ChangeLanguage(evaler connector.Evaler, lang Language) error
- func Connect(connectCtx ConnectCtx, connOpts connector.ConnectOpts) error
- func Eval(connectCtx ConnectCtx, connOpts connector.ConnectOpts, args []string) ([]byte, error)
- type ConnectCtx
- type Console
- type EvalFunc
- type Language
- type LuaValidator
- type SQLValidator
- type ValidateCloser
- type Validator
Constants ¶
const ( HistoryFileName = ".tarantool_history" MaxLivePrefixIndent = 15 MaxHistoryLines = 10000 )
Variables ¶
var ( ControlLeftBytes []byte ControlRightBytes []byte )
Functions ¶
func AddStmtPart ¶
AddStmtPart adds a new part of the statement. It returns a result statement and true if the statement is already completed.
func ChangeLanguage ¶
ChangeLanguage changes a language for a connection.
func Connect ¶
func Connect(connectCtx ConnectCtx, connOpts connector.ConnectOpts) error
Connect establishes a connection to the instance and starts the console.
func Eval ¶
func Eval(connectCtx ConnectCtx, connOpts connector.ConnectOpts, args []string) ([]byte, error)
Eval executes the command on the remote instance (according to args).
Types ¶
type ConnectCtx ¶
type ConnectCtx struct { // Username of the tarantool user. Username string // Password of the tarantool.user. Password string // SrcFile describes the source of code for the evaluation. SrcFile string // Language to use for execution. Language Language // Format to use as an output format. Format formatter.Format // SslKeyFile is a path to a private SSL key file. SslKeyFile string // SslCertFile is a path to an SSL certificate file. SslCertFile string // SslCaFile is a path to a trusted certificate authorities (CA) file. SslCaFile string // SslCiphers is a colon-separated (:) list of SSL cipher suites the // connection can use. SslCiphers string // Interactive mode is used. Interactive bool // ConnectTarget contains connection target string: URI or instance name. ConnectTarget string }
ConnectCtx contains information for connecting to the instance.
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console describes the console connected to the tarantool instance.
func NewConsole ¶
func NewConsole(connOpts connector.ConnectOpts, connectCtx ConnectCtx, title string) (*Console, error)
NewConsole creates a new console connected to the tarantool instance.
type Language ¶
type Language int
Language defines a set of supported languages.
func ParseLanguage ¶
ParseLanguage parses a language string representation. It supports mixed case letters.
type LuaValidator ¶
type LuaValidator struct {
// contains filtered or unexported fields
}
LuaValidator implements ValidateCloser interface for the Lua language.
func NewLuaValidator ¶
func NewLuaValidator() *LuaValidator
NewLuaValidator returns a LuaValidator object.
func (*LuaValidator) Close ¶
func (s *LuaValidator) Close() error
Close closes the Lua validator. It is safe to call it multiple times.
func (*LuaValidator) Validate ¶
func (s *LuaValidator) Validate(str string) bool
Validate returns true if the string is a completed statement for the Lua language.
type SQLValidator ¶
type SQLValidator struct { }
SQLValidator implements ValidateCloser interface for the SQL language.
func NewSQLValidator ¶
func NewSQLValidator() *SQLValidator
NewSQLValidator return a SQLValidator object.
func (SQLValidator) Close ¶
func (v SQLValidator) Close() error
Close closes the SQL validator. It is safe to call it multiple times.
func (SQLValidator) Validate ¶
func (v SQLValidator) Validate(_ string) bool
Validate always returns true.
type ValidateCloser ¶
ValidateCloser is the interface that wraps basic validate methods for a string statement and Close() methods.