Documentation ¶
Index ¶
- Constants
- func MarshalError(err *WiretapError) []byte
- func Pluralize(n int, singular string, plural string) string
- type CompiledIgnoreRewrite
- type CompiledPath
- type CompiledPathDelay
- type CompiledPathRewrite
- type CompiledRedirect
- type CompiledVariable
- type IgnoreRewriteConfig
- type WiretapConfiguration
- func (wtc *WiretapConfiguration) CompileIgnoreRedirects()
- func (wtc *WiretapConfiguration) CompileIgnoreValidations()
- func (wtc *WiretapConfiguration) CompilePathDelays()
- func (wtc *WiretapConfiguration) CompilePaths()
- func (wtc *WiretapConfiguration) CompileRedirectAllowList()
- func (wtc *WiretapConfiguration) CompileValidationAllowList()
- func (wtc *WiretapConfiguration) CompileVariables()
- func (wtc *WiretapConfiguration) GetApiGateway() string
- func (wtc *WiretapConfiguration) GetApiGatewayHost() string
- func (wtc *WiretapConfiguration) GetHttpProtocol() string
- func (wtc *WiretapConfiguration) GetMonitorUI() string
- func (wtc *WiretapConfiguration) ReplaceWithVariables(input string) string
- func (wtc *WiretapConfiguration) UnmarshalJSON(data []byte) error
- func (wtc *WiretapConfiguration) UnmarshalYAML(node *yaml.Node) error
- type WiretapError
- type WiretapHeaderConfig
- type WiretapPathConfig
- type WiretapWebsocketConfig
Constants ¶
View Source
const ConfigKey = "config"
View Source
const HARKey = "har"
View Source
const IndexFile = "index.html"
View Source
const UIAssetsLocation = "ui/dist/assets"
View Source
const UILocation = "ui/dist"
View Source
const WiretapHostPlaceholder = "%WIRETAP_HOST%"
View Source
const WiretapPortPlaceholder = "%WIRETAP_PORT%"
View Source
const WiretapTLSPlaceholder = "%WIRETAP_TLS%"
View Source
const WiretapVersionPlaceholder = "%WIRETAP_VERSION%"
Variables ¶
This section is empty.
Functions ¶
func MarshalError ¶ added in v0.0.8
func MarshalError(err *WiretapError) []byte
Types ¶
type CompiledIgnoreRewrite ¶ added in v0.1.15
type CompiledPath ¶ added in v0.0.13
type CompiledPathDelay ¶ added in v0.0.35
type CompiledPathRewrite ¶ added in v0.0.13
type CompiledRedirect ¶ added in v0.1.4
type CompiledVariable ¶ added in v0.0.20
type IgnoreRewriteConfig ¶ added in v0.1.15
type WiretapConfiguration ¶
type WiretapConfiguration struct { Contract string `json:"-" yaml:"-"` RedirectHost string `json:"redirectHost,omitempty" yaml:"redirectHost,omitempty"` RedirectPort string `json:"redirectPort,omitempty" yaml:"redirectPort,omitempty"` RedirectBasePath string `json:"redirectBasePath,omitempty" yaml:"redirectBasePath,omitempty"` RedirectProtocol string `json:"redirectProtocol,omitempty" yaml:"redirectProtocol,omitempty"` RedirectURL string `json:"redirectURL,omitempty" yaml:"redirectURL,omitempty"` Port string `json:"port,omitempty" yaml:"port,omitempty"` MonitorPort string `json:"monitorPort,omitempty" yaml:"monitorPort,omitempty"` WebSocketHost string `json:"webSocketHost,omitempty" yaml:"webSocketHost,omitempty"` WebSocketPort string `json:"webSocketPort,omitempty" yaml:"webSocketPort,omitempty"` GlobalAPIDelay int `json:"globalAPIDelay,omitempty" yaml:"globalAPIDelay,omitempty"` StaticDir string `json:"staticDir,omitempty" yaml:"staticDir,omitempty"` StaticIndex string `json:"staticIndex,omitempty" yaml:"staticIndex,omitempty"` PathConfigurations *orderedmap.Map[string, *WiretapPathConfig] `json:"paths,omitempty" yaml:"paths,omitempty"` Headers *WiretapHeaderConfig `json:"headers,omitempty" yaml:"headers,omitempty"` StaticPaths []string `json:"staticPaths,omitempty" yaml:"staticPaths,omitempty"` Variables map[string]string `json:"variables,omitempty" yaml:"variables,omitempty"` Spec string `json:"contract,omitempty" yaml:"contract,omitempty"` Certificate string `json:"certificate,omitempty" yaml:"certificate,omitempty"` CertificateKey string `json:"certificateKey,omitempty" yaml:"certificateKey,omitempty"` HardErrors bool `json:"hardValidation,omitempty" yaml:"hardValidation,omitempty"` HardErrorCode int `json:"hardValidationCode,omitempty" yaml:"hardValidationCode,omitempty"` HardErrorReturnCode int `json:"hardValidationReturnCode,omitempty" yaml:"hardValidationReturnCode,omitempty"` PathDelays map[string]int `json:"pathDelays,omitempty" yaml:"pathDelays,omitempty"` MockMode bool `json:"mockMode,omitempty" yaml:"mockMode,omitempty"` UseAllMockResponseFields bool `json:"useAllMockResponseFields,omitempty" yaml:"useAllMockResponseFields,omitempty"` MockModePretty bool `json:"mockModePretty,omitempty" yaml:"mockModePretty,omitempty"` Base string `json:"base,omitempty" yaml:"base,omitempty"` HAR string `json:"har,omitempty" yaml:"har,omitempty"` HARValidate bool `json:"harValidate,omitempty" yaml:"harValidate,omitempty"` HARPathAllowList []string `json:"harPathAllowList,omitempty" yaml:"harPathAllowList,omitempty"` StreamReport bool `json:"streamReport,omitempty" yaml:"streamReport,omitempty"` ReportFile string `json:"reportFilename,omitempty" yaml:"reportFilename,omitempty"` IgnoreRedirects []string `json:"ignoreRedirects,omitempty" yaml:"ignoreRedirects,omitempty"` RedirectAllowList []string `json:"redirectAllowList,omitempty" yaml:"redirectAllowList,omitempty"` WebsocketConfigs map[string]*WiretapWebsocketConfig `json:"websockets" yaml:"websockets"` IgnoreValidation []string `json:"ignoreValidation,omitempty" yaml:"ignoreValidation,omitempty"` ValidationAllowList []string `json:"validationAllowList,omitempty" yaml:"validationAllowList,omitempty"` StrictRedirectLocation bool `json:"strictRedirectLocation,omitempty" yaml:"strictRedirectLocation,omitempty"` IgnorePathRewrite []*IgnoreRewriteConfig `json:"ignorePathRewrite,omitempty" yaml:"ignorePathRewrite,omitempty"` HARFile *harhar.HAR `json:"-" yaml:"-"` CompiledPathDelays map[string]*CompiledPathDelay `json:"-" yaml:"-"` CompiledVariables map[string]*CompiledVariable `json:"-" yaml:"-"` Version string `json:"-" yaml:"-"` StaticPathsCompiled []glob.Glob `json:"-" yaml:"-"` CompiledPaths *orderedmap.Map[string, *CompiledPath] `json:"-"` CompiledIgnoreRedirects []*CompiledRedirect `json:"-" yaml:"-"` CompiledRedirectAllowList []*CompiledRedirect `json:"-" yaml:"-"` CompiledIgnoreValidations []*CompiledRedirect `json:"-" yaml:"-"` CompiledValidationAllowList []*CompiledRedirect `json:"-" yaml:"-"` CompiledIgnorePathRewrite []*CompiledIgnoreRewrite `json:"-" yaml:"-"` FS embed.FS `json:"-"` Logger *slog.Logger }
func (*WiretapConfiguration) CompileIgnoreRedirects ¶ added in v0.1.4
func (wtc *WiretapConfiguration) CompileIgnoreRedirects()
func (*WiretapConfiguration) CompileIgnoreValidations ¶ added in v0.1.7
func (wtc *WiretapConfiguration) CompileIgnoreValidations()
func (*WiretapConfiguration) CompilePathDelays ¶ added in v0.0.35
func (wtc *WiretapConfiguration) CompilePathDelays()
func (*WiretapConfiguration) CompilePaths ¶ added in v0.0.13
func (wtc *WiretapConfiguration) CompilePaths()
func (*WiretapConfiguration) CompileRedirectAllowList ¶ added in v0.1.4
func (wtc *WiretapConfiguration) CompileRedirectAllowList()
func (*WiretapConfiguration) CompileValidationAllowList ¶ added in v0.1.7
func (wtc *WiretapConfiguration) CompileValidationAllowList()
func (*WiretapConfiguration) CompileVariables ¶ added in v0.0.20
func (wtc *WiretapConfiguration) CompileVariables()
func (*WiretapConfiguration) GetApiGateway ¶ added in v0.1.8
func (wtc *WiretapConfiguration) GetApiGateway() string
func (*WiretapConfiguration) GetApiGatewayHost ¶ added in v0.1.8
func (wtc *WiretapConfiguration) GetApiGatewayHost() string
func (*WiretapConfiguration) GetHttpProtocol ¶ added in v0.1.8
func (wtc *WiretapConfiguration) GetHttpProtocol() string
func (*WiretapConfiguration) GetMonitorUI ¶ added in v0.1.8
func (wtc *WiretapConfiguration) GetMonitorUI() string
func (*WiretapConfiguration) ReplaceWithVariables ¶ added in v0.0.20
func (wtc *WiretapConfiguration) ReplaceWithVariables(input string) string
func (*WiretapConfiguration) UnmarshalJSON ¶ added in v0.1.16
func (wtc *WiretapConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON In order to initialize our ordered maps, we need to create custom un-marshallers. This implements json unmarshalling.
func (*WiretapConfiguration) UnmarshalYAML ¶ added in v0.1.16
func (wtc *WiretapConfiguration) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML In order to initialize our ordered maps, we need to create custom un-marshallers. This implements yaml unmarshalling.
type WiretapError ¶ added in v0.0.8
type WiretapError struct { Type string `json:"type,omitempty"` // URI reference to the type of problem Title string `json:"title"` // A short description of the issue Status int `json:"status,omitempty"` // HTTP status code. Detail string `json:"detail"` // explanation of the issue in detail. Instance string `json:"instance,omitempty"` // URI to the specific problem. Payload any `json:"payload,omitempty"` // if added, this is the payload that caused the error }
WiretapError is an rfc7807 compliant error struct
func GenerateError ¶ added in v0.0.8
type WiretapHeaderConfig ¶ added in v0.0.15
type WiretapPathConfig ¶ added in v0.0.13
type WiretapPathConfig struct { Target string `json:"target,omitempty" yaml:"target,omitempty"` PathRewrite map[string]string `json:"pathRewrite,omitempty" yaml:"pathRewrite,omitempty"` ChangeOrigin bool `json:"changeOrigin,omitempty" yaml:"changeOrigin,omitempty"` Headers *WiretapHeaderConfig `json:"headers,omitempty" yaml:"headers,omitempty"` Secure bool `json:"secure,omitempty" yaml:"secure,omitempty"` Auth string `json:"auth,omitempty" yaml:"auth,omitempty"` RewriteId string `json:"rewriteId,omitempty" yaml:"rewriteId,omitempty"` IgnoreRewrite []*IgnoreRewriteConfig `json:"ignoreRewrite,omitempty" yaml:"ignoreRewrite,omitempty"` CompiledPath *CompiledPath `json:"-"` CompiledIgnoreRewrite []*CompiledIgnoreRewrite `json:"-"` }
func (*WiretapPathConfig) Compile ¶ added in v0.0.13
func (wpc *WiretapPathConfig) Compile(key string) *CompiledPath
type WiretapWebsocketConfig ¶ added in v0.1.6
Click to show internal directories.
Click to hide internal directories.