{"modulePath":"github.com/linuxsuren/api-testing","version":"v0.0.21","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package generator\n\nCopyright 2023 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2023 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2023 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2023-2025 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2023 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2024 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2024 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2024 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2023 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2024 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\nCopyright 2024 API Testing Authors.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\n## Functions\n\n```go\nfunc GetCodeGenerators() (result map[string]CodeGenerator)\n```\n\n```go\nfunc GetTestSuiteConverters() (result map[string]TestSuiteConverter)\n```\n\n```go\nfunc RegisterCodeGenerator(name string, generator CodeGenerator)\n```\n\n```go\nfunc RegisterTestSuiteConverter(name string, converter TestSuiteConverter)\n```\n\n## Types\n\n```go\ntype BoolProp struct {\n\tName  string `xml:\"name,attr\"`\n\tValue string `xml:\",chardata\"`\n}\n```\n\n```go\ntype CodeGenerator interface {\n\tGenerate(testSuite *testing.TestSuite, testcase *testing.TestCase) (result string, err error)\n}\n```\nCodeGenerator is the interface of code generator\n\n```go\nfunc GetCodeGenerator(name string) CodeGenerator\n```\n\n```go\nfunc NewCurlGenerator() CodeGenerator\n```\n\n```go\nfunc NewGolangGenerator() CodeGenerator\n```\n\n```go\nfunc NewGrpcPayloadGenerator() CodeGenerator\n```\n\n```go\nfunc NewJavaGenerator() CodeGenerator\n```\n\n```go\nfunc NewJavaScriptGenerator() CodeGenerator\n```\n\n```go\nfunc NewPythonGenerator() CodeGenerator\n```\n\n```go\nfunc NewRobotGenerator() CodeGenerator\n```\n\n```go\ntype CollectionProp struct {\n\tName        string        `xml:\"name,attr\"`\n\tElementProp []ElementProp `xml:\"elementProp\"`\n}\n```\n\n```go\ntype DataImporter interface {\n\tConvert(data []byte) (*testing.TestSuite, error)\n}\n```\n\n```go\ntype ElementProp struct {\n\tName           string           `xml:\"name,attr\"`\n\tType           string           `xml:\"elementType,attr\"`\n\tGUIClass       string           `xml:\"guiclass,attr\"`\n\tTestClass      string           `xml:\"testclass,attr\"`\n\tEnabled        bool             `xml:\"enabled,attr\"`\n\tStringProp     []StringProp     `xml:\"stringProp\"`\n\tBoolProp       []BoolProp       `xml:\"boolProp\"`\n\tCollectionProp []CollectionProp `xml:\"collectionProp\"`\n}\n```\n\n```go\ntype HTTPSamplerProxy struct {\n\tXMLName     xml.Name      `xml:\"HTTPSamplerProxy\"`\n\tName        string        `xml:\"testname,attr\"`\n\tGUIClass    string        `xml:\"guiclass,attr\"`\n\tTestClass   string        `xml:\"testclass,attr\"`\n\tEnabled     bool          `xml:\"enabled,attr\"`\n\tStringProp  []StringProp  `xml:\"stringProp\"`\n\tBoolProp    []BoolProp    `xml:\"boolProp\"`\n\tElementProp []ElementProp `xml:\"elementProp\"`\n}\n```\n\n```go\ntype HashTree struct {\n\tXMLName xml.Name      `xml:\"hashTree\"`\n\tItems   []interface{} `xml:\"items\"`\n}\n```\n\n```go\ntype Importer interface {\n\tDataImporter\n\tConvertFromFile(dataFile string) (*testing.TestSuite, error)\n\tConvertFromURL(dataURL string) (*testing.TestSuite, error)\n}\n```\n\n```go\nfunc NewNativeImporter() Importer\n```\n\n```go\nfunc NewPostmanImporter() Importer\n```\nNewPostmanImporter returns a new postman importer\n\n```go\ntype JmeterTestPlan struct {\n\tXMLName    xml.Name `xml:\"jmeterTestPlan\"`\n\tVersion    string   `xml:\"version,attr\"`\n\tProperties string   `xml:\"properties,attr\"`\n\tJMeter     string   `xml:\"jmeter,attr\"`\n\tHashTree   HashTree `xml:\"hashTree\"`\n}\n```\n\n```go\ntype Pair struct {\n\tKey   string `json:\"key\"`\n\tValue string `json:\"value\"`\n}\n```\n\n```go\ntype Paris []Pair\n```\n\n```go\nfunc (p Paris) ToMap() (result map[string]string)\n```\n\n```go\ntype Postman struct {\n\tInfo PostmanInfo   `json:\"info\"`\n\tItem []PostmanItem `json:\"item\"`\n}\n```\n\n```go\ntype PostmanBody struct {\n\tMode       string      `json:\"mode\"`\n\tRaw        string      `json:\"raw\"`\n\tFormData   []TypeField `json:\"formdata\"`\n\tURLEncoded []TypeField `json:\"urlencoded\"`\n\tDisabled   bool        `json:\"disabled\"`\n}\n```\n\n```go\ntype PostmanCollection struct {\n\tCollection Postman `json:\"collection\"`\n}\n```\n\n```go\ntype PostmanInfo struct {\n\tName string\n}\n```\n\n```go\ntype PostmanItem struct {\n\tName    string         `json:\"name\"`\n\tRequest PostmanRequest `json:\"request\"`\n\tItem    []PostmanItem  `json:\"item\"`\n}\n```\n\n```go\ntype PostmanRequest struct {\n\tMethod string      `json:\"method\"`\n\tURL    PostmanURL  `json:\"url\"`\n\tHeader Paris       `json:\"header\"`\n\tBody   PostmanBody `json:\"body\"`\n}\n```\n\n```go\ntype PostmanURL struct {\n\tRaw   string   `json:\"raw\"`\n\tPath  []string `json:\"path\"`\n\tQuery Paris    `json:\"query\"`\n}\n```\n\n```go\ntype ResultCollector struct {\n\tXMLName   xml.Name `xml:\"ResultCollector\"`\n\tEnabled   bool     `xml:\"enabled,attr\"`\n\tGUIClass  string   `xml:\"guiclass,attr\"`\n\tTestClass string   `xml:\"testclass,attr\"`\n\tName      string   `xml:\"testname,attr\"`\n}\n```\n\n```go\ntype StringProp struct {\n\tName  string `xml:\"name,attr\"`\n\tValue string `xml:\",chardata\"`\n}\n```\n\n```go\ntype TestPlan struct {\n\tXMLName    xml.Name     `xml:\"TestPlan\"`\n\tName       string       `xml:\"testname,attr\"`\n\tGUIClass   string       `xml:\"guiclass,attr\"`\n\tTestClass  string       `xml:\"testclass,attr\"`\n\tEnabled    bool         `xml:\"enabled,attr\"`\n\tStringProp []StringProp `xml:\"stringProp\"`\n}\n```\n\n```go\ntype TestSuiteConverter interface {\n\tConvert(*testing.TestSuite) (result string, err error)\n}\n```\nTestSuiteConverter is the interface of test suite converter\n\n```go\nfunc GetTestSuiteConverter(name string) TestSuiteConverter\n```\n\n```go\ntype ThreadGroup struct {\n\tXMLName     xml.Name     `xml:\"ThreadGroup\"`\n\tGUIClass    string       `xml:\"guiclass,attr\"`\n\tTestClass   string       `xml:\"testclass,attr\"`\n\tEnabled     bool         `xml:\"enabled,attr\"`\n\tName        string       `xml:\"testname,attr\"`\n\tStringProp  []StringProp `xml:\"stringProp\"`\n\tElementProp ElementProp  `xml:\"elementProp\"`\n}\n```\n\n```go\ntype TypeField struct {\n\tKey         string `json:\"key\"`\n\tValue       string `json:\"value\"`\n\tDisabled    bool   `json:\"disabled\"`\n\tType        string `json:\"type\"`\n\tDescription string `json:\"description\"`\n\tSrc         string `json:\"src\"`\n}\n```\n\n","path":"github.com/linuxsuren/api-testing/pkg/generator","name":"generator","synopsis":"","isRedistributable":true}
