Documentation ¶
Index ¶
- Variables
- func CheckRequiredParam(restEndPoint domain.RestEndPoint, command domain.UserCommand) error
- func Contains(s []string, e string) bool
- func GetEndPoints(commandData *domain.CommandData, processRequest impl.RequestHelper) error
- func GetOption(parameters map[string]string, options []string) string
- func GetTargetAndClusterCommand(args []string) (target string, userCommand domain.UserCommand)
- func HasOption(parameters map[string]string, options []string) bool
- func NewCommandProcessor(requester impl.RequestHelper, formatter Formatter, ...) (impl.CommandProcessor, error)
- type Formatter
- type RequestBuilder
Constants ¶
This section is empty.
Variables ¶
View Source
var Exchange = func(request *http.Request) (urlResponse string, statusCode int, err error) { transport := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}} client := &http.Client{Transport: transport} resp, err := client.Do(request) if err != nil { return "", 0, err } urlResponse, err = getURLOutput(resp) statusCode = resp.StatusCode return }
Exchange implements the impl.RequestHelper function type
Functions ¶
func CheckRequiredParam ¶
func CheckRequiredParam(restEndPoint domain.RestEndPoint, command domain.UserCommand) error
CheckRequiredParam checks if required parameters have been provided
func GetEndPoints ¶
func GetEndPoints(commandData *domain.CommandData, processRequest impl.RequestHelper) error
GetEndPoints retrieves available endpoint from the Swagger endpoint on the Geode/PCC locator
func GetTargetAndClusterCommand ¶
func GetTargetAndClusterCommand(args []string) (target string, userCommand domain.UserCommand)
GetTargetAndClusterCommand extracts the target and command from the args and environment variables
func NewCommandProcessor ¶
func NewCommandProcessor(requester impl.RequestHelper, formatter Formatter, requestBuilder RequestBuilder) (impl.CommandProcessor, error)
NewCommandProcessor provides the constructor for the CommandProcessor
Types ¶
type Formatter ¶
type Formatter interface { DescribeEndpoint(domain.RestEndPoint, bool) string FormatResponse(string, string, bool) (string, error) }
Formatter interface provides response and other output formatting
type RequestBuilder ¶
type RequestBuilder func(endpoint domain.RestEndPoint, commandData *domain.CommandData) (request *http.Request, err error)
RequestBuilder is function type generating a request
Directories ¶
Path | Synopsis |
---|---|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
formatfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
Click to show internal directories.
Click to hide internal directories.