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, 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, string, string, []any)
- func GetMySQLTmplToolStatement() (string, string)
- func GetMySQLWants() (string, string, string)
- func GetNonSpannerInvokeParamWant() (string, string, string)
- func GetPostgresSQLAuthToolInfo(tableName string) (string, string, string, []any)
- func GetPostgresSQLParamToolInfo(tableName string) (string, 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, string)
- func GetToolsConfig(sourceConfig map[string]any, ...) map[string]any
- func RunExecuteSqlToolInvokeTest(t *testing.T, createTableStatement string, select1Want string)
- func RunInitialize(t *testing.T, protocolVersion string) string
- func RunMCPToolCallMethod(t *testing.T, invokeParamWant, failInvocationWant 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, invokeParamWantNull 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 ServiceAccountEmail = os.Getenv("SERVICE_ACCOUNT_EMAIL")
Functions ¶
func AddMSSQLExecuteSqlConfig ¶ added in v0.9.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.9.0
GetMSSQLAuthToolInfo returns statements and param of my-auth-tool for mssql-sql kind
func GetMSSQLParamToolInfo ¶ added in v0.9.0
GetMSSQLParamToolInfo returns statements and param for my-param-tool mssql-sql kind
func GetMSSQLTmplToolStatement ¶ added in v0.9.0
GetMSSQLTmplToolStatement returns statements and param for template parameter test cases for mysql-sql kind
func GetMSSQLWants ¶ added in v0.9.0
GetMSSQLWants return the expected wants for mssql
func GetMySQLAuthToolInfo ¶ added in v0.9.0
GetMySQLAuthToolInfo returns statements and param of my-auth-tool for mysql-sql kind
func GetMySQLParamToolInfo ¶ added in v0.9.0
GetMySQLParamToolInfo returns statements and param for my-param-tool mysql-sql kind
func GetMySQLTmplToolStatement ¶ added in v0.9.0
GetMySQLTmplToolStatement returns statements and param for template parameter test cases for mysql-sql kind
func GetMySQLWants ¶ added in v0.9.0
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, paramToolStatement, paramToolStatement2, arrayToolStatement, authToolStatement 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 ¶
func RunToolInvokeTest(t *testing.T, select1Want, invokeParamWant, invokeParamWantNull string, supportsArray bool)
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, createStatement, insertStatement, 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.
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.