(ctx context.Context)
| 220 | } |
| 221 | |
| 222 | func ScalingoDatabaseClient(ctx context.Context) (*scalingo.PreviewClient, error) { |
| 223 | authenticator := &CliAuthenticator{} |
| 224 | _, token, err := authenticator.LoadAuth(ctx) |
| 225 | if err != nil { |
| 226 | return nil, errors.Wrapf(ctx, err, "load credentials") |
| 227 | } |
| 228 | config, err := C.scalingoClientConfig(ctx, ClientConfigOpts{APIToken: token.Token}) |
| 229 | if err != nil { |
| 230 | return nil, errors.Wrap(ctx, err, "create Scalingo client") |
| 231 | } |
| 232 | c, err := scalingo.New(ctx, config) |
| 233 | if err != nil { |
| 234 | return nil, errors.Wrap(ctx, err, "create Scalingo client") |
| 235 | } |
| 236 | return scalingo.NewPreviewClient(c), nil |
| 237 | } |
| 238 | |
| 239 | func ScalingoClientForRegion(ctx context.Context, region string) (*scalingo.Client, error) { |
| 240 | authenticator := &CliAuthenticator{} |
no test coverage detected