Documentation ¶
Index ¶
- Variables
- func CloneURL(u *url.URL) *url.URL
- func InvalidURL(err error) error
- func IsNotFoundError(err error) bool
- func NewHTTPErrorFromBody(resp *http.Response) error
- func NewHTTPErrorf(resp *http.Response, format string, args ...any) error
- func NewKeylimeHTTPClient(options ...HTTPClientOption) (*http.Client, error)
- type HTTPClientOption
- type HTTPError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidURL is returned from New if the provided URL is invalid ErrInvalidURL = errors.New("invalid registrar URL") )
Functions ¶
func InvalidURL ¶
func IsNotFoundError ¶
func NewHTTPErrorFromBody ¶
func NewKeylimeHTTPClient ¶
func NewKeylimeHTTPClient(options ...HTTPClientOption) (*http.Client, error)
NewKeylimeHTTPClient will create an HTTP client which can be used in interaction with the keylime services
Types ¶
type HTTPClientOption ¶
type HTTPClientOption func(*httpClientConfig) error
func ClientCertificate ¶
func ClientCertificate(certFile, keyFile string) HTTPClientOption
func InsecureSkipVerify ¶
func InsecureSkipVerify() HTTPClientOption
func ServerCAFromDER ¶
func ServerCAFromDER(certFile string) HTTPClientOption
func ServerCAFromPEM ¶
func ServerCAFromPEM(certFile string) HTTPClientOption
func SystemServerCA ¶
func SystemServerCA() HTTPClientOption
type HTTPError ¶
type HTTPError struct { StatusCode int `json:"-"` ReqID string `json:"request_id,omitempty"` Err string `json:"status"` }
HTTPError is the error structure as it is always being returned for any unsuccessful HTTP requests by the seeder. Let's define it once here, and reuse it where we need it.
Click to show internal directories.
Click to hide internal directories.