Documentation
¶
Overview ¶
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.
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 SliceToJSON(slice []string) (result string)
- type DataQuery
- type HistoryTestResult
- type InnerSQL
- type TestCase
- type TestSuite
Constants ¶
const ( InnerSelectTable_ = "@selectTable_" InnerSelectTableLimit_ = "@selectTableLImit100_" InnerShowDatabases = "@showDatabases" InnerShowTables = "@showTables" InnerCurrentDB = "@currentDB" )
const ( DialectorPostgres = "postgres" DialectorMySQL = "mysql" DialectorIotDB = "iotdb" )
Variables ¶
This section is empty.
Functions ¶
func ConvertHistoryToRemoteTestCase ¶
func ConvertHistoryToRemoteTestCase(historyTestcase *HistoryTestResult) (result *server.TestCase)
func ConvertToGRPCHistoryTestCase ¶
func ConvertToGRPCHistoryTestCase(historyTestResult *HistoryTestResult) (result *server.HistoryTestCase)
func ConvertToGRPCHistoryTestSuite ¶
func ConvertToGRPCHistoryTestSuite(historyTestResult *HistoryTestResult) (result *remote.HistoryTestSuite)
func ConvertToGRPCTestSuite ¶
func ConvertToRemoteHistoryTestResult ¶
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 SliceToJSON ¶
Types ¶
type DataQuery ¶
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() *client.SessionPool
GetInnerSQL() InnerSQL
}
func NewCommonDataQuery ¶
func NewCommonDataQuery(innerSQL InnerSQL, sessionPool *client.SessionPool) DataQuery
type HistoryTestResult ¶
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 ¶
func ConvertToDBHistoryTestResult(historyTestResult *server.HistoryTestResult) (result *HistoryTestResult)
type InnerSQL ¶
func GetInnerSQL ¶
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
}