Documentation
¶
Overview ¶
Copyright 2023-2024 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023-2025 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func ConvertHistoryToRemoteTestCase(historyTestcase *HistoryTestResult) (result *server.TestCase)
- func ConvertToGRPCHistoryTestCase(historyTestResult *HistoryTestResult) (result *server.HistoryTestCase)
- func ConvertToGRPCHistoryTestSuite(historyTestResult *HistoryTestResult) (result *remote.HistoryTestSuite)
- func ConvertToGRPCTestSuite(suite *TestSuite) (result *remote.TestSuite)
- func ConvertToRemoteHistoryTestResult(historyTestResult *HistoryTestResult) (result *server.HistoryTestResult)
- func ConvertToRemoteTestCase(testcase *TestCase) (result *server.TestCase)
- func NewRemoteServer(defaultHistoryLimit int) (s remote.LoaderServer)
- func NewTDengineDialector(dsn string) gorm.Dialector
- func SliceToJSON(slice []string) (result string)
- type DBQuery
- type DataQuery
- type DatabaseQuery
- type HistoryTestResult
- type InnerSQL
- type TestCase
- type TestSuite
Constants ¶
const ( InnerSelectTable_ = "@selectTable_" InnerSelectTableLimit_ = "@selectTableLImit100_" InnerDescribeTable_ = "@describeTable_" InnerShowDatabases = "@showDatabases" InnerShowTables = "@showTables" InnerCurrentDB = "@currentDB" )
const ( DialectorPostgres = "postgres" DialectorMySQL = "mysql" )
Variables ¶
This section is empty.
Functions ¶
func ConvertHistoryToRemoteTestCase ¶ added in v0.0.11
func ConvertHistoryToRemoteTestCase(historyTestcase *HistoryTestResult) (result *server.TestCase)
func ConvertToGRPCHistoryTestCase ¶ added in v0.0.11
func ConvertToGRPCHistoryTestCase(historyTestResult *HistoryTestResult) (result *server.HistoryTestCase)
func ConvertToGRPCHistoryTestSuite ¶ added in v0.0.11
func ConvertToGRPCHistoryTestSuite(historyTestResult *HistoryTestResult) (result *remote.HistoryTestSuite)
func ConvertToGRPCTestSuite ¶
func ConvertToRemoteHistoryTestResult ¶ added in v0.0.11
func ConvertToRemoteHistoryTestResult(historyTestResult *HistoryTestResult) (result *server.HistoryTestResult)
func ConvertToRemoteTestCase ¶
func NewRemoteServer ¶
func NewRemoteServer(defaultHistoryLimit int) (s remote.LoaderServer)
NewRemoteServer creates a remote server instance
func NewTDengineDialector ¶ added in v0.0.16
func SliceToJSON ¶
Types ¶
type DBQuery ¶ added in v0.0.24
type DBQuery struct {
SQL string `json:"sql" jsonschema:"the sql to be executed"`
}
type DataQuery ¶ added in v0.0.18
type DataQuery interface {
GetDatabases(context.Context) (databases []string, err error)
GetTables(ctx context.Context, currentDatabase string) (tables []string, err error)
GetCurrentDatabase() (string, error)
GetLabels(context.Context, string) []*server.Pair
GetClient() *gorm.DB
GetInnerSQL() InnerSQL
}
type DatabaseQuery ¶ added in v0.0.24
type DatabaseQuery interface {
Query(ctx context.Context, request *mcp.CallToolRequest, query DBQuery) (
result *mcp.CallToolResult, a any, err error)
}
func NewMcpServer ¶ added in v0.0.24
func NewMcpServer(store *testing.Store) DatabaseQuery
type HistoryTestResult ¶ added in v0.0.11
type HistoryTestResult struct {
ID string `gorm:"primaryKey"`
HistorySuiteName string
CreateTime string
//suite information
SuiteName string `json:"suiteName"`
SuiteAPI string
SpecKind string
SpecURL string
Param string
//case information
CaseName string `json:"caseName"`
CaseAPI string
Method string
Body string
Header string
HistoryHeader string
Cookie string
Query string
Form string
ExpectStatusCode int
ExpectBody string
ExpectSchema string
ExpectHeader string
ExpectBodyFields string
ExpectVerify string
//result information
Message string `json:"message"`
Error string `json:"error"`
StatusCode int32 `json:"statusCode"`
Output string `json:"output"`
}
func ConvertToDBHistoryTestResult ¶ added in v0.0.11
func ConvertToDBHistoryTestResult(historyTestResult *server.HistoryTestResult) (result *HistoryTestResult)
type InnerSQL ¶ added in v0.0.18
func GetInnerSQL ¶ added in v0.0.18
type TestCase ¶
type TestCase struct {
SuiteName string `json:"suiteName" gorm:"type:varchar(200);uniqueIndex:idx_name_and_suite_name"`
Name string `gorm:"type:varchar(200);uniqueIndex:idx_name_and_suite_name"`
API string
Method string
Body string
Header string
Cookie string
Query string
Form string
ExpectStatusCode int
ExpectBody string
ExpectSchema string
ExpectHeader string
ExpectBodyFields string
ExpectVerify string
}