client

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetToken

func GetToken(offlineAccessToken string) (string, error)

GetToken retrieves an access token from cache or the sso service

Types

type HTTPWrapper

type HTTPWrapper struct{}

HTTPWrapper manages the headers and auth required to speak with the auth service. It also provides a convenience method to get the bytes from a request.

func (*HTTPWrapper) AddHeaders

func (c *HTTPWrapper) AddHeaders(req *http.Request, cluster_id string, authorization_token string)

AddHeaders sets the client headers, including the auth token

func (*HTTPWrapper) Do

func (c *HTTPWrapper) Do(req *http.Request, label string, cluster_id string, authorization_token string) ([]byte, error)

Do is a convenience wrapper that returns the response bytes

type HttpError

type HttpError struct {
	Message    string
	StatusCode int
}

func (*HttpError) Error

func (h *HttpError) Error() string

type Wrapper

type Wrapper interface {
	Do(req *http.Request, label string, cluster_id string, authorization_token string) ([]byte, error)
}

Wrapper provides a convenience method for getting bytes from a http request

Jump to

Keyboard shortcuts

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