apimanager

package
v0.0.0-...-e9f0680 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormJson      = "application/json"
	FormUrlEncode = "application/x-www-form-urlencoded"
	FormFormData  = "multipart/form-data" //TODO: add implement
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

func NewConfig

func NewConfig() *Config

func (*Config) RegisterFlagsWithPrefix

func (c *Config) RegisterFlagsWithPrefix(prefix string, f *pflag.FlagSet)

RegisterFlagsWithPrefix is used to register flags

func (*Config) Validate

func (c *Config) Validate() error

type Manager

type Manager struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*Manager) ClearCaseEnv

func (m *Manager) ClearCaseEnv()

func (*Manager) LoadCaseEnv

func (m *Manager) LoadCaseEnv(itfName, caseName string)

func (*Manager) MatchAPI

func (m *Manager) MatchAPI(req *interact.Request) (*interact.ImposterMockCase, bool)

MatchAPI is used to match MockAPI

func (*Manager) MockResponse

func (m *Manager) MockResponse(ctx context.Context, request *interact.Request) (*interact.Response, error)

type Provider

type Provider interface {
	// LoadCaseEnv Initialize the environment before executing the use case
	LoadCaseEnv(itfName, caseName string)
	// MockResponse Mock Request.
	MockResponse(ctx context.Context, request *interact.Request) (*interact.Response, error)
	// ClearCaseEnv clear environment
	ClearCaseEnv()
}

func New

func New(log logger.Logger, cfg *Config, caseProvider caseprovider.Provider) Provider

Jump to

Keyboard shortcuts

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