cliutil

package
v2.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureLoggedIn

func EnsureLoggedIn(ctx context.Context) (connector.LoginResult_Code, error)

EnsureLoggedIn ensures that the user is logged in to Ambassador Cloud. An error is returned if login fails. The result code will indicate if this is a new login or if it resued an existing login.

func EnsureLoggedOut

func EnsureLoggedOut(ctx context.Context) error

EnsureLoggedOut ensures that the user is logged out of Ambassador Cloud. Returns nil if not logged in.

func GetCloudAPIKey

func GetCloudAPIKey(ctx context.Context, description string, autoLogin bool) (string, error)

func GetCloudAccessToken

func GetCloudAccessToken(ctx context.Context, autoLogin bool) (string, error)

func HasLoggedIn

func HasLoggedIn(ctx context.Context) bool

HasLoggedIn returns true if either the user has an active login session or an expired login session, and returns false if either the user has never logged in or has explicitly logged out.

func IsConnectorRunning

func IsConnectorRunning() bool

func Logout

func Logout(ctx context.Context) error

Logout logs out of Ambassador Cloud. Returns an error if not logged in.

func QuitConnector

func QuitConnector(ctx context.Context) error

func WithConnector

func WithConnector(ctx context.Context, fn func(context.Context, connector.ConnectorClient) error) error

WithConnector (1) ensures that the connector is running, (2) establishes a connection to it, and (3) runs the given function with that connection.

It streams to stdout any messages that the connector wants us to display to the user (which WithConnector listens for via the UserNotifications gRPC call). WithConnector does NOT make the "Connect" gRPC call or any other gRPC call except for UserNotifications.

Nested calls to WithConnector will reuse the outer connection.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL