extapigateway

package
v2.4.33 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type ApiGatewayThrottleAttackState

type ApiGatewayThrottleAttackState struct {
	ApiId            string
	StageName        string
	Account          string
	Region           string
	ProtocolType     string // "REST" or "HTTP"
	DiscoveredByRole *string

	// Target values (apply to both REST and HTTP).
	TargetRateLimit  float64
	TargetBurstLimit int32

	// REST snapshot pulled from Stage.MethodSettings["*/*"]. Three cases drive the Stop restore:
	//   - HadOriginalThrottleSettings=true → replace throttle fields with the captured values.
	//   - HadOriginalThrottleSettings=false && RestStageHadMethodSetting=true → reset throttle to
	//     account defaults via op=replace value=-1, preserving other MethodSetting fields (caching,
	//     metrics, logging).
	//   - RestStageHadMethodSetting=false → op=remove path=/*/* to delete the MethodSetting our Start
	//     implicitly created. AWS does not support op=remove on individual property paths under a
	//     MethodSetting, so the per-field remove that was here previously erroneously failed.
	OriginalRateLimit           float64
	OriginalBurstLimit          int32
	HadOriginalThrottleSettings bool
	RestStageHadMethodSetting   bool

	// HTTP snapshot: full Stage.DefaultRouteSettings serialised as JSON so we can restore non-throttle
	// fields (DataTraceEnabled, DetailedMetricsEnabled, LoggingLevel) verbatim. Empty string means
	// DefaultRouteSettings was nil; on Stop we send an empty RouteSettings to clear what we set.
	HttpOrigDefaultRouteSettings string
}

ApiGatewayThrottleAttackState captures the throttle config of an API Gateway stage so we can restore it on stop. The same state struct serves both REST (v1) and HTTP (v2) stages — ProtocolType drives the branching in Prepare/Start/Stop.

type HttpApiGatewayApi

type HttpApiGatewayApi interface {
	GetApis(ctx context.Context, params *apigatewayv2.GetApisInput, optFns ...func(*apigatewayv2.Options)) (*apigatewayv2.GetApisOutput, error)
	GetStages(ctx context.Context, params *apigatewayv2.GetStagesInput, optFns ...func(*apigatewayv2.Options)) (*apigatewayv2.GetStagesOutput, error)
	GetStage(ctx context.Context, params *apigatewayv2.GetStageInput, optFns ...func(*apigatewayv2.Options)) (*apigatewayv2.GetStageOutput, error)
	UpdateStage(ctx context.Context, params *apigatewayv2.UpdateStageInput, optFns ...func(*apigatewayv2.Options)) (*apigatewayv2.UpdateStageOutput, error)
}

type RestApiGatewayApi

type RestApiGatewayApi interface {
	GetRestApis(ctx context.Context, params *apigateway.GetRestApisInput, optFns ...func(*apigateway.Options)) (*apigateway.GetRestApisOutput, error)
	GetStages(ctx context.Context, params *apigateway.GetStagesInput, optFns ...func(*apigateway.Options)) (*apigateway.GetStagesOutput, error)
	GetStage(ctx context.Context, params *apigateway.GetStageInput, optFns ...func(*apigateway.Options)) (*apigateway.GetStageOutput, error)
	UpdateStage(ctx context.Context, params *apigateway.UpdateStageInput, optFns ...func(*apigateway.Options)) (*apigateway.UpdateStageOutput, error)
}

Jump to

Keyboard shortcuts

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