MCPcopy Create free account
hub / github.com/Scalingo/cli / ScalingoClientForRegion

Function ScalingoClientForRegion

config/config.go:239–252  ·  view source on GitHub ↗
(ctx context.Context, region string)

Source from the content-addressed store, hash-verified

237}
238
239func 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
254func ScalingoUnauthenticatedAuthClient(ctx context.Context) (*scalingo.Client, error) {
255 config := C.scalingoClientBaseConfig(ClientConfigOpts{AuthOnly: true})

Callers

nothing calls this directly

Calls 2

LoadAuthMethod · 0.95

Tested by

no test coverage detected