cli

package
v0.0.0-...-5a75034 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const CallbackCSS = `` /* 169-byte string literal not displayed */
View Source
const MISSING_CONTEXT = "You must have a token in your context to perform this command."
View Source
const MISSING_TARGET = "You must set a target in order to use this command."

Variables

View Source
var InteractiveInput io.Reader = os.Stdin
View Source
var InteractiveOutput io.Writer = os.Stdout
View Source
var ReadPassword func(fd int) ([]byte, error) = terminal.ReadPassword

Functions

func EnsureContextInConfig

func EnsureContextInConfig(cfg config.Config) error

func EnsureTargetInConfig

func EnsureTargetInConfig(cfg config.Config) error

func MissingArgumentError

func MissingArgumentError(argName string) error

func MissingArgumentWithExplanationError

func MissingArgumentWithExplanationError(argName string, explanation string) error

func NotifyErrorsWithRetry

func NotifyErrorsWithRetry(err error, log Logger, c config.Config)

func NotifyValidationErrors

func NotifyValidationErrors(err error, cmd *cobra.Command, log Logger)

Types

type AuthCallbackServer

type AuthCallbackServer struct {
	// contains filtered or unexported fields
}

func NewAuthCallbackServer

func NewAuthCallbackServer(html, css, js string, log Logger, port int) AuthCallbackServer

func (AuthCallbackServer) CSS

func (acs AuthCallbackServer) CSS() string

func (AuthCallbackServer) Hangup

func (acs AuthCallbackServer) Hangup(done chan url.Values, values url.Values)

func (AuthCallbackServer) Html

func (acs AuthCallbackServer) Html() string

func (AuthCallbackServer) Javascript

func (acs AuthCallbackServer) Javascript() string

func (AuthCallbackServer) Log

func (acs AuthCallbackServer) Log() Logger

func (AuthCallbackServer) Port

func (acs AuthCallbackServer) Port() int

func (*AuthCallbackServer) SetHangupFunc

func (acs *AuthCallbackServer) SetHangupFunc(hangupFunc func(chan url.Values, url.Values))

func (AuthCallbackServer) Start

func (acs AuthCallbackServer) Start(done chan url.Values)

type AuthcodeClientImpersonator

type AuthcodeClientImpersonator struct {
	ClientID           string
	ClientSecret       string
	TokenFormat        string
	Scope              string
	UaaBaseURL         string
	Port               int
	Log                Logger
	AuthCallbackServer CallbackServer
	BrowserLauncher    func(string) error
	// contains filtered or unexported fields
}

func NewAuthcodeClientImpersonator

func NewAuthcodeClientImpersonator(
	config config.Config,
	clientId,
	clientSecret,
	tokenFormat,
	scope string,
	port int,
	log Logger,
	launcher func(string) error) AuthcodeClientImpersonator

func (AuthcodeClientImpersonator) Authorize

func (aci AuthcodeClientImpersonator) Authorize()

func (AuthcodeClientImpersonator) Done

func (aci AuthcodeClientImpersonator) Done() chan oauth2.Token

func (AuthcodeClientImpersonator) Start

func (aci AuthcodeClientImpersonator) Start()

type CallbackServer

type CallbackServer interface {
	Html() string
	CSS() string
	Javascript() string
	Port() int
	Log() Logger
	Hangup(chan url.Values, url.Values)
	Start(chan url.Values)
}

type ClientImpersonator

type ClientImpersonator interface {
	Start()
	Authorize()
	Done() chan oauth2.Token
}

type FakeCallbackServer

type FakeCallbackServer struct {
	// contains filtered or unexported fields
}

func (FakeCallbackServer) CSS

func (fcs FakeCallbackServer) CSS() string

func (FakeCallbackServer) Hangup

func (fcs FakeCallbackServer) Hangup(done chan url.Values, values url.Values)

func (FakeCallbackServer) Html

func (fcs FakeCallbackServer) Html() string

func (FakeCallbackServer) Javascript

func (fcs FakeCallbackServer) Javascript() string

func (FakeCallbackServer) Log

func (fcs FakeCallbackServer) Log() Logger

func (FakeCallbackServer) Port

func (fcs FakeCallbackServer) Port() int

func (*FakeCallbackServer) SetHangupFunc

func (fcs *FakeCallbackServer) SetHangupFunc(hangupFunc func(chan url.Values, url.Values))

func (FakeCallbackServer) Start

func (fcs FakeCallbackServer) Start(done chan url.Values)

type ImplicitClientImpersonator

type ImplicitClientImpersonator struct {
	ClientID           string
	TokenFormat        string
	Scope              string
	UaaBaseURL         string
	Port               int
	Log                Logger
	AuthCallbackServer CallbackServer
	BrowserLauncher    func(string) error
	// contains filtered or unexported fields
}

func NewImplicitClientImpersonator

func NewImplicitClientImpersonator(clientId,
	uaaBaseURL string,
	tokenFormat string,
	scope string,
	port int,
	log Logger,
	launcher func(string) error) ImplicitClientImpersonator

func (ImplicitClientImpersonator) Authorize

func (ici ImplicitClientImpersonator) Authorize()

func (ImplicitClientImpersonator) Done

func (ici ImplicitClientImpersonator) Done() chan oauth2.Token

func (ImplicitClientImpersonator) Start

func (ici ImplicitClientImpersonator) Start()

type InteractivePrompt

type InteractivePrompt struct {
	Prompt string
}

func (InteractivePrompt) Get

func (ip InteractivePrompt) Get() (string, error)

type InteractiveSecret

type InteractiveSecret struct {
	Prompt string
}

func (*InteractiveSecret) Get

func (is *InteractiveSecret) Get() (string, error)

type JsonPrinter

type JsonPrinter struct {
	Log Logger
}

func NewJsonPrinter

func NewJsonPrinter(log Logger) JsonPrinter

func (JsonPrinter) Print

func (jp JsonPrinter) Print(obj interface{}) error

func (JsonPrinter) PrintError

func (jp JsonPrinter) PrintError(b []byte) error

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(infoHandle, robotsHandle, warningHandle, errorHandle io.Writer) Logger

func (*Logger) Error

func (l *Logger) Error(msg string)

func (*Logger) Errorf

func (l *Logger) Errorf(format string, a ...interface{})

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) Infof

func (l *Logger) Infof(format string, a ...interface{})

func (*Logger) Mute

func (l *Logger) Mute()

func (*Logger) Robots

func (l *Logger) Robots(msg string)

func (*Logger) Robotsf

func (l *Logger) Robotsf(format string, a ...interface{})

func (*Logger) Unmute

func (l *Logger) Unmute()

func (*Logger) Warn

func (l *Logger) Warn(msg string)

type Printer

type Printer interface {
	Print(interface{}) error
}

type TestPrinter

type TestPrinter struct {
	CallData map[string]interface{}
}

func NewTestPrinter

func NewTestPrinter() TestPrinter

func (TestPrinter) Print

func (tp TestPrinter) Print(obj interface{}) error

Jump to

Keyboard shortcuts

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