(ctx context.Context, region string)
| 237 | } |
| 238 | |
| 239 | func ScalingoClientForRegion(ctx context.Context, region string) (*scalingo.Client, error) { |
| 240 | authenticator := &CliAuthenticator{} |
| 241 | _, token, err := authenticator.LoadAuth(ctx) |
| 242 | if err != nil { |
| 243 | return nil, errors.Wrapf(ctx, err, "fail to load credentials") |
| 244 | } |
| 245 | |
| 246 | config := C.scalingoClientBaseConfig(ClientConfigOpts{ |
| 247 | Region: region, |
| 248 | APIToken: token.Token, |
| 249 | }) |
| 250 | |
| 251 | return scalingo.New(ctx, config) |
| 252 | } |
| 253 | |
| 254 | func ScalingoUnauthenticatedAuthClient(ctx context.Context) (*scalingo.Client, error) { |
| 255 | config := C.scalingoClientBaseConfig(ClientConfigOpts{AuthOnly: true}) |
nothing calls this directly
no test coverage detected