99 "github.com/aws/aws-sdk-go-v2/aws"
1010 "github.com/aws/aws-sdk-go-v2/service/apigateway"
1111 apiGatewayTypes "github.com/aws/aws-sdk-go-v2/service/apigateway/types"
12+ "github.com/patrickmn/go-cache"
1213)
1314
1415type APIGatewayClientInterface interface {
@@ -66,7 +67,7 @@ func CachedApiGatewayGetRestAPIs(client APIGatewayClientInterface, accountID str
6667 }
6768 PaginationControl = GetRestApis .Position
6869 }
69-
70+ internal . Cache . Set ( cacheKey , restAPIs , cache . DefaultExpiration )
7071 return restAPIs , nil
7172}
7273
@@ -92,6 +93,7 @@ func CachedApiGatewayGetStages(client APIGatewayClientInterface, accountID strin
9293 return apigateway.GetStagesOutput {}, err
9394 }
9495
96+ internal .Cache .Set (cacheKey , GetStages , cache .DefaultExpiration )
9597 return * GetStages , err
9698}
9799
@@ -129,7 +131,7 @@ func CachedApiGatewayGetResources(client APIGatewayClientInterface, accountID st
129131 }
130132 PaginationControl = GetResources .Position
131133 }
132-
134+ internal . Cache . Set ( cacheKey , resources , cache . DefaultExpiration )
133135 return resources , nil
134136}
135137
@@ -166,7 +168,7 @@ func CachedApiGatewayGetDomainNames(client APIGatewayClientInterface, accountID
166168 }
167169 PaginationControl = GetDomainNames .Position
168170 }
169-
171+ internal . Cache . Set ( cacheKey , domainNames , cache . DefaultExpiration )
170172 return domainNames , nil
171173}
172174
@@ -204,7 +206,7 @@ func CachedApiGatewayGetBasePathMappings(client APIGatewayClientInterface, accou
204206 }
205207 PaginationControl = GetBasePathMappings .Position
206208 }
207-
209+ internal . Cache . Set ( cacheKey , basePathMappings , cache . DefaultExpiration )
208210 return basePathMappings , nil
209211}
210212
@@ -233,6 +235,7 @@ func CachedApiGatewayGetMethod(client APIGatewayClientInterface, accountID strin
233235 return apigateway.GetMethodOutput {}, err
234236 }
235237
238+ internal .Cache .Set (cacheKey , GetMethod , cache .DefaultExpiration )
236239 return * GetMethod , nil
237240
238241}
@@ -271,6 +274,7 @@ func CachedApiGatewayGetUsagePlans(client APIGatewayClientInterface, accountID s
271274 PaginationControl = GetUsagePlans .Position
272275 }
273276
277+ internal .Cache .Set (cacheKey , usagePlans , cache .DefaultExpiration )
274278 return usagePlans , nil
275279}
276280
@@ -309,5 +313,6 @@ func CachedApiGatewayGetUsagePlanKeys(client APIGatewayClientInterface, accountI
309313 PaginationControl = GetUsagePlanKeys .Position
310314 }
311315
316+ internal .Cache .Set (cacheKey , usagePlanKeys , cache .DefaultExpiration )
312317 return usagePlanKeys , nil
313318}
0 commit comments