Versions in this module Expand all Collapse all v1 v1.0.0 Dec 20, 2023 Changes in this version + var ErrMissingEndpoint = errors.New("missing Endpoint in config") + var ErrMissingEndpointEnv = errors.New("missing environment variable KEYCTL_ENDPOINT") + var ErrMissingEndpointInURL = errors.New("missing host in URL") + var ErrMissingIDInURL = errors.New("missing ID in URL") + var ErrNotFound = errors.New("not found") + var ErrRedirect = Redirect + var ErrUnsupportedScheme = errors.New("unsupported scheme") + func KeyFromURL(url string) (id, share string, err error) + type Client struct + func NewClient(options ...ClientOption) *Client + func (c *Client) Do(r *http.Request, v any) (resp *http.Response, err error) + func (c *Client) FollowRedirect(r *http.Request, v any, delay time.Duration) (resp *http.Response, err error) + func (c *Client) FollowRedirectLoop(r *http.Request, v any, delay time.Duration) (resp *http.Response, err error) + func (c *Client) NewRequest(ctx context.Context, method, path string, body io.Reader) (*http.Request, error) + type ClientOption func(*Client) + func ClientOptionsFromConfig(cfg Config) (options []ClientOption, err error) + func ClientOptionsFromEnv() (options []ClientOption, err error) + func ClientOptionsFromURL(url string) (options []ClientOption, err error) + func WithDebugWriter(debugWriter io.Writer) ClientOption + func WithEndpoint(endpoint string) ClientOption + func WithHTTPClient(httpClient *http.Client) ClientOption + type Config struct + Endpoint string + type Error struct + Code int + Err string + func (e Error) Error() string + func (e Error) Is(target error) bool + type Redirect struct + Code int + Location string + func (r Redirect) Error() string