Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheStatus ¶
type CacheStatus struct {
Dirty bool `json:"dirty"`
FallbackScanEnabled bool `json:"fallback_scan_enabled"`
Fingerprint string `json:"fingerprint"`
LastBuildAt string `json:"last_build_at,omitempty"`
LastError string `json:"last_error,omitempty"`
OverlayCount int `json:"overlay_count"`
RebuildCount uint64 `json:"rebuild_count"`
StaleServedCount uint64 `json:"stale_served_count"`
WatchEnabled bool `json:"watch_enabled"`
WatchError string `json:"watch_error,omitempty"`
}
CacheStatus exposes runtime cache metadata for diagnostics.
type Config ¶
type Config struct {
APIURL string
Debug bool
DevToken string
EventsJSON bool
ExcludeRules []string
Host string
IncludeRules []string
MaxBodyBytes int64
Port int
QuietRequests bool
Site string
TemplateRoot string
UseColor bool
UserAgent string
Watch bool
WatchScanInterval time.Duration
}
Config controls proxy server behavior.
type Logger ¶
type Logger struct {
DebugEnabled bool
EventsJSON bool
UseColor bool
// contains filtered or unexported fields
}
Logger provides human and structured runtime output.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher decides whether a request should be handled by the simulator proxy.
func NewMatcher ¶
NewMatcher builds a matcher from route rule strings.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server hosts the local simulator proxy.
type SimulatorClient ¶
type SimulatorClient interface {
SimulatorRender(ctx context.Context, payload api.SimulatorPayload) (*api.SimulatorResponse, error)
}
SimulatorClient is the API client dependency for simulator render calls.
type TemplateCache ¶
type TemplateCache struct {
// contains filtered or unexported fields
}
TemplateCache caches compressed template payloads and invalidates on changes.
func NewTemplateCache ¶
func (*TemplateCache) GetCompressed ¶
func (c *TemplateCache) GetCompressed() (code string, stale bool, err error)
GetCompressed returns compressed template payload. stale=true indicates stale cache served due to rebuild error.
func (*TemplateCache) SetOverlays ¶ added in v0.1.13
func (c *TemplateCache) SetOverlays(overlays []TemplateOverlay) error
func (*TemplateCache) Start ¶
func (c *TemplateCache) Start() error
func (*TemplateCache) Status ¶
func (c *TemplateCache) Status() CacheStatus
func (*TemplateCache) Stop ¶
func (c *TemplateCache) Stop() error
type TemplateOverlay ¶ added in v0.1.13
type TemplateOverlay struct {
Content string `json:"content"`
Path string `json:"path"`
Type string `json:"type"`
}
TemplateOverlay is an in-memory template replacement supplied by the local dev server.