utils

package
v0.0.0-...-3361740 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UsernameEnvVar is the environment variable that points to the username
	UsernameEnvVar = "ABRARACOURCIX_USERNAME"

	// ApikeyEnvVar is the environment variable that points to the APIKEY
	ApikeyEnvVar = "ABRARACOURCIX_APIKEY"

	// GrpcAddr is the environment variable that points to the gRPC server
	GrpcAddr = "ABRARACOURCIX_SERVER"
)

Variables

View Source
var (
	GreenOut  = color.New(color.FgGreen).SprintFunc()
	YellowOut = color.New(color.FgYellow).SprintFunc()
	RedOut    = color.New(color.FgRed).SprintFunc()
)
View Source
var (
	Username string
	Password string

	ServerAddress string
)
View Source
var (
	ErrUsernameNotFound    = errors.New("Username not found")
	ErrApiKeyNotFound      = errors.New("API key not found")
	ErrGrpcAddressNotFound = errors.New("gRPC address not found")
)

Functions

func NewCompletionCommand

func NewCompletionCommand(out io.Writer, example string) *cobra.Command

func NewVersionCmd

func NewVersionCmd(out io.Writer, help string) *cobra.Command

func RunCompletion

func RunCompletion(out io.Writer, cmd *cobra.Command, args []string) error

Types

type GRPCClient

type GRPCClient struct {
	ServerAddress  string
	Username       string
	Password       string
	Authentication auth.Authentication
}

GRPCClient define a client using gRPC protocol

func NewGRPCClient

func NewGRPCClient(cmd *cobra.Command) (*GRPCClient, error)

NewGRPCClient creates a new gRPC client

func (*GRPCClient) GetConn

func (client *GRPCClient) GetConn() (*grpc.ClientConn, error)

func (*GRPCClient) GetContext

func (client *GRPCClient) GetContext(cliName string) (context.Context, error)

Jump to

Keyboard shortcuts

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