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 GetRedisValkeyToolsConfig(sourceConfig map[string]any, toolKind string) map[string]any
- func GetRedisValkeyWants() (string, string, string, string)
- func GetToolsConfig(sourceConfig map[string]any, ...) map[string]any
- func RunExecuteSqlToolInvokeTest(t *testing.T, createTableStatement string, select_1_want string)
- func RunInitialize(t *testing.T, protocolVersion string) string
- func RunMCPToolCallMethod(t *testing.T, invokeParamWant, 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, select1Want, invokeParamWant string)
- func RunToolInvokeWithTemplateParameters(t *testing.T, tableName string, config *TemplateParameterTestConfig)
- 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
- type Option
- type TemplateParameterTestConfig
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 GetRedisValkeyToolsConfig ¶ added in v0.8.0
func GetRedisValkeyWants ¶ added in v0.8.0
GetRedisWants return the expected wants for redis
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 RunInitialize ¶ added in v0.8.0
RunInitialize runs the initialize lifecycle for mcp to set up client-server connection
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 RunToolInvokeWithTemplateParameters(t *testing.T, tableName string, config *TemplateParameterTestConfig)
RunToolInvokeWithTemplateParameters runs tool invoke test cases with template parameters.
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.
type Option ¶ added in v0.8.0
type Option func(*TemplateParameterTestConfig)
func WithCreateColArray ¶ added in v0.8.0
WithCreateColArray is the option function to configure replaceNameColFilter.
func WithIgnoreDdl ¶ added in v0.8.0
func WithIgnoreDdl() Option
WithIgnoreDdl is the option function to configure ignoreDdl.
func WithIgnoreInsert ¶ added in v0.8.0
func WithIgnoreInsert() Option
WithIgnoreInsert is the option function to configure ignoreInsert.
func WithReplaceNameColFilter ¶ added in v0.8.0
WithReplaceNameColFilter is the option function to configure replaceNameColFilter.
func WithReplaceNameFieldArray ¶ added in v0.8.0
WithReplaceNameFieldArray is the option function to configure replaceNameFieldArray.
func WithSelect1Want ¶ added in v0.8.0
WithSelect1Want is the option function to configure select1Want.
func WithSelectAllWant ¶ added in v0.8.0
WithSelectAllWant is the option function to configure selectAllWant.
type TemplateParameterTestConfig ¶ added in v0.8.0
type TemplateParameterTestConfig struct {
// contains filtered or unexported fields
}
TemplateParameterTestConfig represents the various configuration options for template parameter tests.
func NewTemplateParameterTestConfig ¶ added in v0.8.0
func NewTemplateParameterTestConfig(options ...Option) *TemplateParameterTestConfig
NewTemplateParameterTestConfig creates a new TemplateParameterTestConfig instances with options.