utils

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRDAHost      string = "https://gw.api.openshift.io"
	CRDAAuthToken string = "207c527cfc2a6b8dcf4fa43ad7a976da"
	Debug         bool   = false
	ActualHost    string = "https://recommender.api.openshift.io"
)

Flag Defaults

Variables

View Source
var ErrorSilent = errors.New("SilentError")

ErrorSilent is an error that triggers exit code 1 without any error messaging

Functions

func BuildReportLink(stackID string) string

BuildReportLink builds stack report UI Link

func HTTPRequest

func HTTPRequest(data HTTPRequestType) *http.Response

HTTPRequest is generic method for HTTP Requests to server

func HTTPRequestMultipart

func HTTPRequestMultipart(data HTTPRequestType, w *multipart.Writer, buf *bytes.Buffer) *http.Response

HTTPRequestMultipart is generic method for HTTP Multipart Requests to server

func MinimumArgs

func MinimumArgs(n int, msg string) cobra.PositionalArgs

MinimumArgs validates for Minimum arg in cmd

Types

type FlagError

type FlagError struct {
	Err error
}

FlagError is the kind of error raised in flag processing

func (FlagError) Error

func (fe FlagError) Error() string

func (FlagError) Unwrap

func (fe FlagError) Unwrap() error

type GenericPayload

type GenericPayload interface{}

GenericPayload is Generic Interface of Request Payload

type HTTPRequestType

type HTTPRequestType struct {
	Payload         GenericPayload `json:"payload,omitempty"`
	Method          string         `json:"method,omitempty"`
	Endpoint        string         `json:"endpoint,omitempty"`
	ThreeScaleToken string         `json:"threeScale,omitempty"`
	Host            string         `json:"host,omitempty"`
	UserID          string         `json:"user_id,omitempty"`
	Client          string         `json:"client,omitempty"`
}

HTTPRequestType is request type HTTPRequest Method accepts

Jump to

Keyboard shortcuts

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