Documentation
¶
Index ¶
- Constants
- type Client
- func (cli *Client) Checker(ctx context.Context, check *health.CheckState) error
- func (cli *Client) DeleteRedirect(ctx context.Context, options Options, id string) apiError.Error
- func (cli *Client) GetRedirect(ctx context.Context, options Options, key string) (*models.Redirect, apiError.Error)
- func (cli *Client) GetRedirects(ctx context.Context, options Options) (*models.Redirects, apiError.Error)
- func (cli *Client) Health() *healthcheck.Client
- func (cli *Client) PutRedirect(ctx context.Context, options Options, id string, payload models.Redirect) apiError.Error
- func (cli *Client) URL() string
- type Clienter
- type Options
- type ResponseInfo
Constants ¶
const ( // RedirectEndpoint is the endpoint for a single redirect. RedirectEndpoint = "%s/v1/redirects/%s" // RedirectsEndpoint is the listing endpoint for redirects. RedirectsEndpoint = "%s/v1/redirects" )
const ( // Authorization represents the HTTP Authorization header. Authorization string = request.AuthHeaderKey )
List of available headers
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a client for interacting with the redirect API.
func NewWithHealthClient ¶
func NewWithHealthClient(hcCli *healthcheck.Client) *Client
NewWithHealthClient creates a new instance of redirect API Client, reusing the URL and Clienter from the provided healthcheck client
func (*Client) Checker ¶
Checker calls redirect api health endpoint and returns a check object to the caller
func (*Client) DeleteRedirect ¶ added in v0.3.3
func (cli *Client) DeleteRedirect( ctx context.Context, options Options, id string, ) apiError.Error
DeleteRedirect deletes a redirect via the /redirects/{id} endpoint
func (*Client) GetRedirect ¶ added in v0.3.0
func (cli *Client) GetRedirect(ctx context.Context, options Options, key string) (*models.Redirect, apiError.Error)
GetRedirect gets the /redirects/{id} endpoint
func (*Client) GetRedirects ¶ added in v0.3.5
func (cli *Client) GetRedirects(ctx context.Context, options Options) (*models.Redirects, apiError.Error)
GetRedirects gets the /redirects endpoint
func (*Client) Health ¶
func (cli *Client) Health() *healthcheck.Client
Health returns the underlying Healthcheck Client for this redirect API client
type Clienter ¶ added in v1.4.0
type Clienter interface {
URL() string
Health() *healthcheck.Client
Checker(ctx context.Context, check *health.CheckState) error
GetRedirect(ctx context.Context, options Options, key string) (*models.Redirect, apiError.Error)
GetRedirects(ctx context.Context, options Options) (*models.Redirects, apiError.Error)
PutRedirect(ctx context.Context, options Options, id string, payload models.Redirect) apiError.Error
DeleteRedirect(ctx context.Context, options Options, id string) apiError.Error
}
Clienter is an interface defining the methods available for interacting with the redirect API.
type ResponseInfo ¶
type ResponseInfo struct {
// Body contains the response body as a byte slice.
Body []byte
// Headers contains the HTTP headers returned in the response.
Headers http.Header
// Status contains the HTTP status code returned in the response.
Status int
}
ResponseInfo represents the response information returned from a call to the redirect API.