Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoginCmd ¶
NewLoginCmd returns a new instance of the login command.
func RunOAuthFlow ¶
func RunOAuthFlow(ctx context.Context, opts *LoginOptions, signup bool) error
RunOAuthFlow runs the full browser-based OAuth + profile setup flow. If signup is true, the browser opens to the sign-up page instead of sign-in.
Types ¶
type LoginOptions ¶
type LoginOptions struct {
IO *iostreams.IOStreams
Config config.IConfig
AppName string
ProfileName string
Region string
Default bool
// NoBrowser disables automatic browser opening; the authorize URL is
// printed instead. The CLI still starts a local callback server and
// waits for the redirect.
NoBrowser bool
// NonInteractive disables every prompt and defaults the output to JSON, so
// the command is usable from scripts. It signs in only: unless --app-name
// names one, choosing an application is left to `algolia application select`.
// The browser step is unaffected - the authorize URL still has to be opened
// for the flow to complete.
NonInteractive bool
// PrintFlags is nil for callers that don't expose output flags (e.g. signup).
PrintFlags *cmdutil.PrintFlags
NewDashboardClient func(clientID string) *dashboard.Client
}
LoginOptions holds all options for the login command.
Click to show internal directories.
Click to hide internal directories.