Documentation ¶
Overview ¶
Package contract provides the implementation of the contract service
Index ¶
- func AppendInParameters(parameters []models.Parameter, inParameters map[string]string, ...) []models.Parameter
- func ExtractIdentifiers(path string) []string
- func ExtractQueryParams(rawURL string) (map[string]string, error)
- func ExtractURLPath(URL string) (string, string)
- func ExtractVariableTypes(obj map[string]interface{}) map[string]map[string]interface{}
- func GenerateDummyNamesForIdentifiers(identifiers []string) map[string]string
- func GenerateHeader(header map[string]string) []models.Parameter
- func GenerateResponse(response Response) map[string]models.ResponseItem
- func ReplacePathIdentifiers(path string, dummyNames map[string]string) string
- type MockDB
- type OpenAPIDB
- type Response
- type Service
- type TestDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendInParameters ¶
func ExtractIdentifiers ¶
ExtractIdentifiers extracts numeric identifiers (integers or floats) from the path.
func ExtractQueryParams ¶
ExtractQueryParams extracts the query parameters and their names from the URL.
func ExtractURLPath ¶
func ExtractVariableTypes ¶
ExtractVariableTypes returns the type of each variable in the object.
func GenerateDummyNamesForIdentifiers ¶
GenerateDummyNamesForIdentifiers generates dummy names for the path identifiers.
func GenerateResponse ¶
func GenerateResponse(response Response) map[string]models.ResponseItem
Types ¶
type OpenAPIDB ¶
type OpenAPIDB interface { GetTestCasesSchema(ctx context.Context, testSetID string, testPath string) ([]*models.OpenAPI, error) GetMocksSchemas(ctx context.Context, testSetID string, mockPath string, mockFileName string) ([]*models.OpenAPI, error) WriteSchema(ctx context.Context, logger *zap.Logger, outputPath, name string, openapi models.OpenAPI, isAppend bool) error ChangePath(path string) }
Directories ¶
Path | Synopsis |
---|---|
Package consumer is a package for consumer driven contract testing
|
Package consumer is a package for consumer driven contract testing |
Package provider is a package for provider driven contract testing
|
Package provider is a package for provider driven contract testing |
Click to show internal directories.
Click to hide internal directories.