Documentation
¶
Index ¶
- Constants
- Variables
- func Func(method, path string, f func(ctx *gin.Context)) error
- func HostDockerInternal() string
- func JSON(method, path string, response map[string]any, statusCode int) error
- func RecordKey(method, path string) string
- type CustomResponseWriter
- type Input
- type Output
- type Record
- type Records
Constants ¶
View Source
const (
DefaultFakeServicePort = 9111
)
Variables ¶
View Source
var (
R = NewRecords()
)
View Source
var (
Service *gin.Engine
)
Functions ¶
func HostDockerInternal ¶
func HostDockerInternal() string
HostDockerInternal returns host.docker.internal that works both locally and in GHA
Types ¶
type CustomResponseWriter ¶
type CustomResponseWriter struct {
gin.ResponseWriter
// contains filtered or unexported fields
}
CustomResponseWriter wraps gin.ResponseWriter to capture response data
type Input ¶
type Input struct {
Image string `toml:"image" comment:"Fake service image, usually can be found in our ECR with $project-fakes name"`
ContainerName string `toml:"container_name" comment:"Docker container name"`
Port int `toml:"port" validate:"required" comment:"The port which Docker container is exposing"`
Out *Output `toml:"out" comment:"Fakes service config output"`
}
type Output ¶
type Output struct {
UseCache bool `toml:"use_cache" comment:"Whether to respect caching or not, if cache = true component won't be deployed again"`
BaseURLHost string `toml:"base_url_host" comment:"Base URL which can be used when running locally"`
BaseURLDocker string `toml:"base_url_docker" comment:"Base URL to reach fakes service from other Docker containers"`
// K8sService is a Kubernetes service spec used to connect locally
K8sService *v1.Service `toml:"k8s_service" comment:"Kubernetes service spec used to connect locally"`
}
func NewDockerFakeDataProvider ¶
NewDockerFakeDataProvider creates new fake data provider in Docker using testcontainers-go
func NewFakeDataProvider ¶
NewFakeDataProvider creates new fake data provider
Click to show internal directories.
Click to hide internal directories.