utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOAuth2Client

func CreateOAuth2Client(ctx context.Context, accessToken string, sslVerify bool) *http.Client

createOAuth2Client returns an HTTP client with oauth2 authentication using the provided accessToken

func GetClientAllowsSelfSigned

func GetClientAllowsSelfSigned() *http.Client

func GetGitProviderAndAPIURL

func GetGitProviderAndAPIURL(inputURL string) (string, string, error)

Returns (provider, apiurl, error):

func GetWebhookSecretTokens

func GetWebhookSecretTokens(kubeClient k8sclient.Interface, namespace, name string) (accessToken string, secretToken string, err error)

getWebhookSecretTokens returns the "secretToken" and "accessToken" stored in the Secret with the name specified by the parameter, and in the namespace specified by r.Defaults.Namespace.

func RespondError

func RespondError(response *restful.Response, err error, statusCode int)

RespondError - logs and writes an error response with a desired status code

func RespondErrorMessage

func RespondErrorMessage(response *restful.Response, message string, statusCode int)

RespondErrorMessage - logs and writes an error message with a desired status code

func RespondMessageAndLogError

func RespondMessageAndLogError(response *restful.Response, err error, message string, statusCode int)

RespondMessageAndLogError - logs and writes an error message with a desired status code and logs the error

Types

This section is empty.

Jump to

Keyboard shortcuts

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