Documentation
¶
Index ¶
- Constants
- Variables
- type Application
- type Arguments
- type Config
- type ConfigProvider
- type ConfigProviderFactory
- type DataCrawler
- type DataCrawlerHandler
- type DataCrawlerOption
- type DataCrawlerSettings
- type ExpressionDescriptor
- type ExpressionFactory
- type ExpressionFactoryIn
- type ExpressionType
- type Iterator
- type List
- type ListOption
- type ListSettings
- type Logger
- type LoggerFactory
- type Map
- type MediaConverter
- type MediaType
- type PostProcessor
- type SortFunc
- type SpecType
- type Suite
- type Template
- type TemplateContainer
- type Worker
- type WorkerContainer
- type WorkerContainerFxIn
- type WorkerType
Constants ¶
View Source
const ( HeaderContentType = "Content-Type" HeaderAccept = "Accept" )
View Source
const ( ExpressionDateLayoutRFC3339 string = "RFC3339" ExpressionDateLayoutRFC3339Nano string = "RFC3339NANO" )
View Source
const ( LoggerReservedKeyExpected = "Expected" LoggerReservedKeyActual = "Actual" )
Variables ¶
View Source
var Constructors = fx.Provide( NewFxMediaConverter, NewFxWorkerContainer, NewFxDataCrawler, NewFxExpressionFactory, NewFxLoggerFactory, NewFxConfigProviderFactory, )
View Source
var (
ErrUnsupportedMediaType = errors.New("unsupported media type")
)
View Source
var (
ErrUnsupportedWorkerType = errors.New("unsupported worker type")
)
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(providers ...interface{}) *Application
func (*Application) Run ¶
func (a *Application) Run(invoker interface{})
type Arguments ¶
type Arguments struct {
Mode WorkerType `short:"m" long:"mode" required:"true"`
SpecLocation string `short:"s" long:"spec-location"`
SpecType SpecType `short:"f" long:"spec-format" default:"oa2"`
Url string `short:"u" long:"url"`
Variables map[string]string `short:"v" long:"variable"`
Tags []string `short:"t" long:"tags"`
CertFilename string `long:"cert-filename"`
KeyFilename string `long:"key-filename"`
ConfigFilename string `short:"c" long:"config-filename"`
}
type Config ¶
type Config struct {
Testers map[string]interface{} `yaml:"testers"`
Reporters map[string]interface{} `yaml:"reporters"`
Variables map[string]interface{} `yaml:"variables"`
}
func NewFxConfig ¶
func NewFxConfig( arguments Arguments, loggerFactory LoggerFactory, configProviderFactory ConfigProviderFactory, ) (*Config, error)
type ConfigProvider ¶
type ConfigProviderFactory ¶
type ConfigProviderFactory interface {
CreateByFiles(filenames ...string) (ConfigProvider, error)
CreateByOptions(options ...config.YAMLOption) (ConfigProvider, error)
}
func NewFxConfigProviderFactory ¶
func NewFxConfigProviderFactory() ConfigProviderFactory
type DataCrawler ¶
type DataCrawler interface {
Walk(data interface{}, handler DataCrawlerHandler, opts ...DataCrawlerOption)
}
func NewFxDataCrawler ¶
func NewFxDataCrawler() DataCrawler
type DataCrawlerHandler ¶
type DataCrawlerHandler func(k string, v interface{})
type DataCrawlerOption ¶
type DataCrawlerOption func(settings *DataCrawlerSettings)
func WithJoinKeys ¶
func WithJoinKeys() DataCrawlerOption
func WithPrefix ¶
func WithPrefix(prefix string) DataCrawlerOption
func WithSkipCollections ¶
func WithSkipCollections() DataCrawlerOption
type DataCrawlerSettings ¶
type DataCrawlerSettings struct {
// contains filtered or unexported fields
}
type ExpressionDescriptor ¶
type ExpressionDescriptor struct {
Type ExpressionType
Name string
Constructor interface{}
}
type ExpressionFactory ¶
type ExpressionFactory interface {
Create(exprType ExpressionType, exprName interface{}) (interface{}, error)
}
func NewFxExpressionFactory ¶
func NewFxExpressionFactory(in ExpressionFactoryIn) ExpressionFactory
type ExpressionFactoryIn ¶
type ExpressionFactoryIn struct {
fx.In
Descriptors []ExpressionDescriptor `group:"expression_descriptor"`
}
type ExpressionType ¶
type ExpressionType string
const ( ExpressionTypeAsserter ExpressionType = "asserter" ExpressionTypeGenerator ExpressionType = "generator" )
type Iterator ¶
func NewListIterator ¶
func NewMapIterator ¶
func NewMapIterator[K comparable, V any](iterable Map[K, V]) Iterator[V]
type List ¶
type List[T any] interface { Add(items ...T) Set(i int, item T) Get(i int) T Len() int Entries() []T Iterator() Iterator[T] Remove(i int) RemoveAll() Sort(f SortFunc[T]) }
func NewList ¶
func NewList[T any](opts ...ListOption) List[T]
func NewListFromSlice ¶
type ListOption ¶
type ListOption func(settings *ListSettings)
func WithListSize ¶
func WithListSize(size int) ListOption
type ListSettings ¶
type ListSettings struct {
// contains filtered or unexported fields
}
type Logger ¶
type Logger interface {
Debug(args ...interface{})
Info(args ...interface{})
Warn(args ...interface{})
Error(args ...interface{})
Fatal(args ...interface{})
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
With(args ...interface{}) Logger
Infow(string, ...interface{})
Named(string) Logger
PrintGroup(msg string, args ...interface{})
PrintSubGroup(msg string, args ...interface{})
PrintSubGroupName(msg string, args ...interface{})
PrintParameter(key string, value interface{})
PrintParameters(header string, parameters map[string]interface{})
}
type LoggerFactory ¶
type LoggerFactory interface {
CreateCommonLogger() Logger
CreateErrorLogger() Logger
CreateSuccessLogger() Logger
}
func NewFxLoggerFactory ¶
func NewFxLoggerFactory() LoggerFactory
type Map ¶
type Map[K comparable, V any] interface { Set(key K, value V) Get(key K) (V, bool) Len() int Entries() map[K]V Iterator() Iterator[V] Remove(key K) RemoveAll() }
func NewMap ¶
func NewMap[K comparable, V any]() Map[K, V]
type MediaConverter ¶
type MediaConverter interface {
Marshal(mediaType MediaType, i interface{}) ([]byte, error)
Unmarshal(mediaType MediaType, buf []byte) (interface{}, error)
}
func NewFxMediaConverter ¶
func NewFxMediaConverter() MediaConverter
type PostProcessor ¶
type Suite ¶
type Suite struct {
suite.Suite
Ctrl *gomock.Controller
}
func (*Suite) TearDownTest ¶
func (s *Suite) TearDownTest()
type Template ¶
type Template struct {
UID string
BaseUrl string
Path string
Method string
HeaderParams map[string]interface{}
PathParams map[string]interface{}
QueryParams map[string]interface{}
CookieParams map[string]interface{}
ExpectedResponses map[int]map[string]interface{}
Bodies map[string]interface{}
Tags []string
PostProcessors []PostProcessor
Priority int
}
func (*Template) ContainsTags ¶
func (Template) GetQueryParams ¶
type TemplateContainer ¶
func (TemplateContainer) Create ¶
func (c TemplateContainer) Create(exampleName, baseUrl, pathName, httpMethod string) *Template
type WorkerContainer ¶
type WorkerContainer map[WorkerType]Worker
func NewFxWorkerContainer ¶
func NewFxWorkerContainer(in WorkerContainerFxIn) WorkerContainer
func (WorkerContainer) Get ¶
func (c WorkerContainer) Get(workerType WorkerType) (Worker, error)
type WorkerContainerFxIn ¶
type WorkerType ¶
type WorkerType string
const ( WorkerTypeMock WorkerType = "mock" WorkerTypeTest WorkerType = "test" WorkerTypeTest2 WorkerType = "test2" WorkerTypeE2E WorkerType = "e2e" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.