common

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTPScenarioType represents type "http" for a scenario
	HTTPScenarioType = "http"
	// GraphQLScenarioType represents type "graphql" for a scenario
	GraphQLScenarioType = "graphql"
	// KafkaScenarioType represents type "kafka" for a scenario
	KafkaScenarioType = "kafka"
)

Variables

View Source
var (
	// ScenarioTypeValidator is a validator rule for the type of a scenario
	// can be http or graphql
	// in the feature should add kafka and grpc
	ScenarioTypeValidator = []validation.Rule{
		validation.Required,
		validation.In(HTTPScenarioType, GraphQLScenarioType, KafkaScenarioType),
	}
	// ScenarioMethodValidator is a validator rule for the method type of a scenario
	// must be any type of HTTP methods
	ScenarioMethodValidator = []validation.Rule{
		validation.Required,
		validation.In(http.MethodPost, http.MethodGet, http.MethodPut,
			http.MethodConnect, http.MethodDelete, http.MethodHead,
			http.MethodOptions, http.MethodPatch, http.MethodTrace),
	}
	// BaseScenariosValidator is a validator rule for a base validation of the field scenarios
	// must be required
	BaseScenariosValidator = []validation.Rule{
		validation.Required,
	}
	// CodeStatus is a validator rule for the field codeStatus
	// must be required
	CodeStatusValidator = []validation.Rule{
		validation.Required,
		validation.Min(http.StatusOK),
		validation.Max(http.StatusNetworkAuthenticationRequired),
	}
	// URLPathValidator is a validator rule for the URL path
	// must be required
	// a string must be a valid URL
	URLPathValidator = []validation.Rule{
		validation.Required,
		is.URL,
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL