MCPcopy Create free account
hub / github.com/barnybug/cli53 / getService

Function getService

util.go:263–279  ·  view source on GitHub ↗
(c *cli.Context)

Source from the content-addressed store, hash-verified

261}
262
263func getService(c *cli.Context) (*route53.Client, error) {
264 cfg, err := getConfig(c)
265 if err != nil {
266 return nil, err
267 }
268
269 roleARN := c.String("role-arn")
270 if roleARN != "" {
271 cfg.Credentials = aws.NewCredentialsCache(stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), roleARN))
272 }
273
274 return route53.NewFromConfig(cfg, func(o *route53.Options) {
275 if endpoint := c.String("endpoint-url"); endpoint != "" {
276 o.BaseEndpoint = aws.String(endpoint)
277 }
278 }), nil
279}
280
281func fatalIfErr(err error) {
282 if err != nil {

Callers 1

MainFunction · 0.70

Calls 2

getConfigFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected