Documentation
¶
Overview ¶
Copyright 2024-2025 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 API Testing Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamicServer ¶
type DynamicServer interface { Start(reader Reader, prefix string) error SetupHandler(reader Reader, prefix string) (http.Handler, error) Stop() error GetPort() string EnableMetrics() Loadable }
func NewInMemoryServer ¶
func NewInMemoryServer(ctx context.Context, port int) DynamicServer
type InMemoryMetrics ¶ added in v0.0.19
type InMemoryMetrics struct { MetricData // contains filtered or unexported fields }
InMemoryMetrics implements RequestMetrics with in-memory storage
func NewInMemoryMetrics ¶ added in v0.0.19
func NewInMemoryMetrics() *InMemoryMetrics
NewInMemoryMetrics creates a new InMemoryMetrics instance
func (*InMemoryMetrics) AddMetricsHandler ¶ added in v0.0.19
func (m *InMemoryMetrics) AddMetricsHandler(mux MetricsHandler)
func (*InMemoryMetrics) GetMetrics ¶ added in v0.0.19
func (m *InMemoryMetrics) GetMetrics() MetricData
GetMetrics returns a copy of the current metrics
func (*InMemoryMetrics) RecordRequest ¶ added in v0.0.19
func (m *InMemoryMetrics) RecordRequest(path string)
RecordRequest records a request for the given path
type MetricData ¶ added in v0.0.19
type MetricsHandler ¶ added in v0.0.19
type NoopMetrics ¶ added in v0.0.19
type NoopMetrics struct{}
NoopMetrics implements RequestMetrics but does nothing
func NewNoopMetrics ¶ added in v0.0.19
func NewNoopMetrics() *NoopMetrics
NewNoopMetrics creates a new NoopMetrics instance
func (*NoopMetrics) AddMetricsHandler ¶ added in v0.0.19
func (m *NoopMetrics) AddMetricsHandler(mux MetricsHandler)
AddMetricsHandler implements RequestMetrics but does nothing
func (*NoopMetrics) GetMetrics ¶ added in v0.0.19
func (m *NoopMetrics) GetMetrics() MetricData
GetMetrics implements RequestMetrics but returns empty map
func (*NoopMetrics) RecordRequest ¶ added in v0.0.19
func (m *NoopMetrics) RecordRequest(path string)
RecordRequest implements RequestMetrics but does nothing
type Proxy ¶ added in v0.0.18
type Proxy struct { Path string `yaml:"path" json:"path"` Target string `yaml:"target" json:"target"` RequestAmend RequestAmend `yaml:"requestAmend" json:"requestAmend"` }
type ReaderAndWriter ¶
func NewInMemoryReader ¶
func NewInMemoryReader(config string) ReaderAndWriter
func NewLocalFileReader ¶
func NewLocalFileReader(file string) ReaderAndWriter
type RequestAmend ¶ added in v0.0.19
type RequestAmend struct {
BodyPatch string `yaml:"bodyPatch" json:"bodyPatch"`
}
type RequestMetrics ¶ added in v0.0.19
type RequestMetrics interface { RecordRequest(path string) GetMetrics() MetricData AddMetricsHandler(MetricsHandler) }
RequestMetrics represents an interface for collecting request metrics
type RequestWithAuth ¶ added in v0.0.19
type Webhook ¶
type Webhook struct { Name string `yaml:"name" json:"name"` Timer string `yaml:"timer" json:"timer"` Request RequestWithAuth `yaml:"request" json:"request"` }