mock

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccessTokenBody

func GetAccessTokenBody(accessToken, idToken, refreshToken, clientInfo string, expiresIn int) []byte

func GetIDToken

func GetIDToken(tenant, issuer string) string

func GetInstanceDiscoveryBody

func GetInstanceDiscoveryBody(host, tenant string) []byte

func GetTenantDiscoveryBody

func GetTenantDiscoveryBody(host, tenant string) []byte

func WithBody

func WithBody(b []byte) responseOption

WithBody sets the HTTP response's body to the specified value.

func WithCallback

func WithCallback(callback func(*http.Request)) responseOption

WithCallback sets a callback to invoke before returning the response.

Types

type Client

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

Client is a mock HTTP client that returns a sequence of responses. Use AppendResponse to specify the sequence.

func (*Client) AppendResponse

func (c *Client) AppendResponse(opts ...responseOption)

func (*Client) CloseIdleConnections

func (*Client) CloseIdleConnections()

CloseIdleConnections implements the comm.HTTPClient interface

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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