cli

package
v1.3.14 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSessionFolder string
View Source
var Output io.Writer = os.Stdout

Functions

func DefaultArgsShellComp added in v1.3.2

func DefaultArgsShellComp(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

func PromptForLogin added in v1.3.11

func PromptForLogin() (loginRequest *auth.LoginRequest, err error)

func ValidArgsGetCloudServices added in v1.3.11

func ValidArgsGetCloudServices(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func ValidArgsGetMetrics added in v1.3.2

func ValidArgsGetMetrics(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func ValidArgsGetTools added in v1.3.2

func ValidArgsGetTools(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

Types

type GRPCFormatter added in v1.3.7

type GRPCFormatter struct {
	logrus.TextFormatter
}

func (*GRPCFormatter) Format added in v1.3.7

func (f *GRPCFormatter) Format(entry *logrus.Entry) ([]byte, error)

type Session

type Session struct {
	URL   string `json:"url"`
	Token string `json:"token"`

	Folder string `json:"-"`

	*grpc.ClientConn
}

func ContinueSession

func ContinueSession() (session *Session, err error)

func NewSession

func NewSession(url string, opts ...grpc.DialOption) (session *Session, err error)

func (*Session) AuthenticatedContext added in v1.3.2

func (s *Session) AuthenticatedContext(ctx context.Context) context.Context

func (*Session) HandleResponse

func (*Session) HandleResponse(msg proto.Message, err error) error

HandleResponse handles the response and error message of an gRPC call

func (*Session) Invoke added in v1.3.2

func (s *Session) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error

Invoke implements `grpc.ClientConnInterface` and automatically provides an authenticated context of this session

func (*Session) NewStream added in v1.3.2

func (s *Session) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)

NewStream implements `grpc.ClientConnInterface` and automatically provides an authenticated context of this session

func (*Session) Save

func (s *Session) Save() (err error)

Save saves the session into the `.clouditor` folder in the home directory

Jump to

Keyboard shortcuts

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