http

package
v1.60.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKubeToken

func GetKubeToken() (string, error)

func SetBearerToken

func SetBearerToken(req *http.Request, token string)

func SetKubeAuthToken

func SetKubeAuthToken(req *http.Request) error

Types

type Client

type Client interface {
	Do(req *http.Request) (*http.Response, error)
}

Client interface

func NewClient

func NewClient(options ...Option) Client

type ClientMock

type ClientMock struct {
	DoMock mClientMockDo
	// contains filtered or unexported fields
}

ClientMock implements Client

func NewClientMock

func NewClientMock(t minimock.Tester) *ClientMock

NewClientMock returns a mock for Client

func (*ClientMock) Do

func (mmDo *ClientMock) Do(req *http.Request) (rp1 *http.Response, err error)

Do implements Client

func (*ClientMock) DoAfterCounter

func (mmDo *ClientMock) DoAfterCounter() uint64

DoAfterCounter returns a count of finished ClientMock.Do invocations

func (*ClientMock) DoBeforeCounter

func (mmDo *ClientMock) DoBeforeCounter() uint64

DoBeforeCounter returns a count of ClientMock.Do invocations

func (*ClientMock) MinimockDoDone

func (m *ClientMock) MinimockDoDone() bool

MinimockDoDone returns true if the count of the Do invocations corresponds the number of defined expectations

func (*ClientMock) MinimockDoInspect

func (m *ClientMock) MinimockDoInspect()

MinimockDoInspect logs each unmet expectation

func (*ClientMock) MinimockFinish

func (m *ClientMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*ClientMock) MinimockWait

func (m *ClientMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type ClientMockDoExpectation

type ClientMockDoExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockDoExpectation specifies expectation struct of the Client.Do

func (*ClientMockDoExpectation) Then

Then sets up Client.Do return parameters for the expectation previously defined by the When method

type ClientMockDoParams

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

ClientMockDoParams contains parameters of the Client.Do

type ClientMockDoResults

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

ClientMockDoResults contains results of the Client.Do

type Option

type Option func(options *httpOptions)

func WithAdditionalCACerts

func WithAdditionalCACerts(certs [][]byte) Option

func WithInsecureSkipVerify

func WithInsecureSkipVerify() Option

WithInsecureSkipVerify skip tls certificate validation

func WithTLSServerName

func WithTLSServerName(name string) Option

func WithTimeout

func WithTimeout(t time.Duration) Option

WithTimeout set custom timeout for http request. Default: 10 seconds

Jump to

Keyboard shortcuts

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