Documentation
¶
Index ¶
- Variables
- func AddMssqlExecuteSqlConfig(t *testing.T, config map[string]any) map[string]any
- func AddMySqlExecuteSqlConfig(t *testing.T, config map[string]any) map[string]any
- func AddPgExecuteSqlConfig(t *testing.T, config map[string]any) map[string]any
- func AddTemplateParamConfig(t *testing.T, config map[string]any, ...) map[string]any
- func GetCloudSQLDialOpts(ipType string) ([]cloudsqlconn.DialOption, error)
- func GetGoogleIdToken(audience string) (string, error)
- func GetMssqlAuthToolInfo(tableName string) (string, string, string, []any)
- func GetMssqlParamToolInfo(tableName string) (string, string, string, []any)
- func GetMssqlTmplToolStatement() (string, string)
- func GetMssqlWants() (string, string, string)
- func GetMysqlAuthToolInfo(tableName string) (string, string, string, []any)
- func GetMysqlParamToolInfo(tableName string) (string, string, string, []any)
- func GetMysqlTmplToolStatement() (string, string)
- func GetMysqlWants() (string, string, string)
- func GetNonSpannerInvokeParamWant() (string, string)
- func GetPostgresSQLAuthToolInfo(tableName string) (string, string, string, []any)
- func GetPostgresSQLParamToolInfo(tableName string) (string, string, string, []any)
- func GetPostgresSQLTmplToolStatement() (string, string)
- func GetPostgresWants() (string, string, string)
- func GetToolsConfig(sourceConfig map[string]any, ...) map[string]any
- func RunExecuteSqlToolInvokeTest(t *testing.T, createTableStatement string, select_1_want string)
- func RunMCPToolCallMethod(t *testing.T, invoke_param_want, fail_invocation_want string)
- func RunSourceConnectionTest(t *testing.T, sourceConfig map[string]any, toolKind string) error
- func RunToolGetTest(t *testing.T)
- func RunToolInvokeTest(t *testing.T, select_1_want, invoke_param_want string)
- func RunToolInvokeWithTemplateParameters(t *testing.T, tableName string)
- func SetupMsSQLTable(t *testing.T, ctx context.Context, pool *sql.DB, ...) func(*testing.T)
- func SetupMySQLTable(t *testing.T, ctx context.Context, pool *sql.DB, ...) func(*testing.T)
- func SetupPostgresSQLTable(t *testing.T, ctx context.Context, pool *pgxpool.Pool, ...) func(*testing.T)
- type CmdExec
Constants ¶
This section is empty.
Variables ¶
var ClientId = os.Getenv("CLIENT_ID")
var SERVICE_ACCOUNT_EMAIL = os.Getenv("SERVICE_ACCOUNT_EMAIL")
Functions ¶
func AddMssqlExecuteSqlConfig ¶ added in v0.6.0
AddMssqlExecuteSqlConfig gets the tools config for `mssql-execute-sql`
func AddMySqlExecuteSqlConfig ¶ added in v0.6.0
AddMySqlExecuteSqlConfig gets the tools config for `mysql-execute-sql`
func AddPgExecuteSqlConfig ¶
AddPgExecuteSqlConfig gets the tools config for `postgres-execute-sql`
func AddTemplateParamConfig ¶ added in v0.7.0
func GetCloudSQLDialOpts ¶
func GetCloudSQLDialOpts(ipType string) ([]cloudsqlconn.DialOption, error)
GetCloudSQLDialOpts returns cloud sql connector's dial option for ip type.
func GetGoogleIdToken ¶
GetGoogleIdToken retrieve and return the Google ID token
func GetMssqlAuthToolInfo ¶ added in v0.7.0
GetMssqlAuthToolInfo returns statements and param of my-auth-tool for mssql-sql kind
func GetMssqlParamToolInfo ¶
GetMssqlParamToolInfo returns statements and param for my-param-tool mssql-sql kind
func GetMssqlTmplToolStatement ¶ added in v0.7.0
GetMssqlTmplToolStatement returns statements and param for template parameter test cases for mysql-sql kind
func GetMssqlWants ¶
GetMssqlWants return the expected wants for mssql
func GetMysqlAuthToolInfo ¶ added in v0.7.0
GetMysqlAuthToolInfo returns statements and param of my-auth-tool for mysql-sql kind
func GetMysqlParamToolInfo ¶
GetMysqlParamToolInfo returns statements and param for my-param-tool mysql-sql kind
func GetMysqlTmplToolStatement ¶ added in v0.7.0
GetMysqlTmplToolStatement returns statements and param for template parameter test cases for mysql-sql kind
func GetMysqlWants ¶
GetMysqlWants return the expected wants for mysql
func GetPostgresSQLAuthToolInfo ¶
GetPostgresSQLAuthToolInfo returns statements and param of my-auth-tool for postgres-sql kind
func GetPostgresSQLParamToolInfo ¶
GetPostgresSQLParamToolInfo returns statements and param for my-param-tool postgres-sql kind
func GetPostgresSQLTmplToolStatement ¶ added in v0.7.0
GetPostgresSQLTmplToolStatement returns statements and param for template parameter test cases for postgres-sql kind
func GetPostgresWants ¶
GetPostgresWants return the expected wants for postgres
func GetToolsConfig ¶
func GetToolsConfig(sourceConfig map[string]any, toolKind, param_tool_statement, auth_tool_statement string) map[string]any
GetToolsConfig returns a mock tools config file
func RunExecuteSqlToolInvokeTest ¶ added in v0.6.0
func RunMCPToolCallMethod ¶
RunMCPToolCallMethod runs the tool/call for mcp endpoint
func RunSourceConnectionTest ¶
RunSourceConnection test for source connection
func RunToolInvokeTest ¶
RunToolInvoke runs the tool invoke endpoint
func RunToolInvokeWithTemplateParameters ¶ added in v0.7.0
func SetupMsSQLTable ¶
func SetupMsSQLTable(t *testing.T, ctx context.Context, pool *sql.DB, create_statement, insert_statement, tableName string, params []any) func(*testing.T)
SetupMsSQLTable creates and inserts data into a table of tool compatible with mssql-sql tool
Types ¶
type CmdExec ¶
type CmdExec struct {
Out io.ReadCloser
// contains filtered or unexported fields
}
CmdExec represents an invocation of a toolbox command.
func StartCmd ¶
func StartCmd(ctx context.Context, toolsFile map[string]any, args ...string) (*CmdExec, func(), error)
StartCmd returns a CmdExec representing a running instance of a toolbox command.
func (*CmdExec) Close ¶
func (c *CmdExec) Close()
Close releases any resources associated with the instance.