Documentation ¶
Index ¶
- Variables
- func KeyFromURL(url string) (id, share string, err error)
- type 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 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
- type Error
- type Redirect
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingEndpointEnv = errors.New("missing environment variable KEYCTL_ENDPOINT") ErrMissingEndpointInURL = errors.New("missing host in URL") ErrMissingIDInURL = errors.New("missing ID in URL") ErrUnsupportedScheme = errors.New("unsupported scheme") ErrMissingEndpoint = errors.New("missing Endpoint in config") )
View Source
var (
ErrNotFound = errors.New("not found")
)
View Source
var ErrRedirect = Redirect{}
Functions ¶
func KeyFromURL ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ...ClientOption) *Client
func (*Client) FollowRedirect ¶
func (*Client) FollowRedirectLoop ¶
type ClientOption ¶
type ClientOption func(*Client)
func ClientOptionsFromConfig ¶
func ClientOptionsFromConfig(cfg Config) (options []ClientOption, err error)
func ClientOptionsFromEnv ¶
func ClientOptionsFromEnv() (options []ClientOption, err error)
func ClientOptionsFromURL ¶
func ClientOptionsFromURL(url string) (options []ClientOption, err error)
func WithDebugWriter ¶
func WithDebugWriter(debugWriter io.Writer) ClientOption
func WithEndpoint ¶
func WithEndpoint(endpoint string) ClientOption
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
Click to show internal directories.
Click to hide internal directories.