Documentation ¶
Index ¶
- func AnalyticsShortnerPath(path string) string
- func CreateShortnerPath() string
- func DeleteShortnerPath(path string) string
- func GetShortnerPath(path string) string
- func UpdateShortnerPath(path string) string
- type Analytics
- type Client
- func (c *Client) AnalyticsShortner(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) CreateShortner(ctx context.Context, path string, payload *CreateLinkPayload) (*http.Response, error)
- func (c *Client) DecodeAnalytics(resp *http.Response) (*Analytics, error)
- func (c *Client) DecodeURL(resp *http.Response) (*URL, error)
- func (c *Client) DeleteShortner(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) GetShortner(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) NewAnalyticsShortnerRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewCreateShortnerRequest(ctx context.Context, path string, payload *CreateLinkPayload) (*http.Request, error)
- func (c *Client) NewDeleteShortnerRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewGetShortnerRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewUpdateShortnerRequest(ctx context.Context, path string, payload *UpdateLinkPayload) (*http.Request, error)
- func (c *Client) UpdateShortner(ctx context.Context, path string, payload *UpdateLinkPayload) (*http.Response, error)
- type CreateLinkPayload
- type URL
- type UpdateLinkPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyticsShortnerPath ¶
AnalyticsShortnerPath computes a request path to the analytics action of shortner.
func CreateShortnerPath ¶
func CreateShortnerPath() string
CreateShortnerPath computes a request path to the create action of shortner.
func DeleteShortnerPath ¶
DeleteShortnerPath computes a request path to the delete action of shortner.
func GetShortnerPath ¶
GetShortnerPath computes a request path to the get action of shortner.
func UpdateShortnerPath ¶
UpdateShortnerPath computes a request path to the update action of shortner.
Types ¶
type Analytics ¶
type Analytics struct {
Hits *int `form:"hits,omitempty" json:"hits,omitempty" yaml:"hits,omitempty" xml:"hits,omitempty"`
}
Url analytics (default view)
Identifier: application/vnd.analytics+json; view=default
type Client ¶
type Client struct { *goaclient.Client Encoder *goa.HTTPEncoder Decoder *goa.HTTPDecoder }
Client is the URL shortner API service client.
func (*Client) AnalyticsShortner ¶
Get analytics for a URL
func (*Client) CreateShortner ¶
func (c *Client) CreateShortner(ctx context.Context, path string, payload *CreateLinkPayload) (*http.Response, error)
Create a url
func (*Client) DecodeAnalytics ¶
DecodeAnalytics decodes the Analytics instance encoded in resp body.
func (*Client) DeleteShortner ¶
Delete a url
func (*Client) GetShortner ¶
Get a URL
func (*Client) NewAnalyticsShortnerRequest ¶
func (c *Client) NewAnalyticsShortnerRequest(ctx context.Context, path string) (*http.Request, error)
NewAnalyticsShortnerRequest create the request corresponding to the analytics action endpoint of the shortner resource.
func (*Client) NewCreateShortnerRequest ¶
func (c *Client) NewCreateShortnerRequest(ctx context.Context, path string, payload *CreateLinkPayload) (*http.Request, error)
NewCreateShortnerRequest create the request corresponding to the create action endpoint of the shortner resource.
func (*Client) NewDeleteShortnerRequest ¶
NewDeleteShortnerRequest create the request corresponding to the delete action endpoint of the shortner resource.
func (*Client) NewGetShortnerRequest ¶
NewGetShortnerRequest create the request corresponding to the get action endpoint of the shortner resource.
func (*Client) NewUpdateShortnerRequest ¶
func (c *Client) NewUpdateShortnerRequest(ctx context.Context, path string, payload *UpdateLinkPayload) (*http.Request, error)
NewUpdateShortnerRequest create the request corresponding to the update action endpoint of the shortner resource.
func (*Client) UpdateShortner ¶
func (c *Client) UpdateShortner(ctx context.Context, path string, payload *UpdateLinkPayload) (*http.Response, error)
Update a url
type CreateLinkPayload ¶
type CreateLinkPayload struct { Path string `form:"path" json:"path" yaml:"path" xml:"path"` URL string `form:"url" json:"url" yaml:"url" xml:"url"` }
CreateLinkPayload user type.
func (*CreateLinkPayload) Validate ¶
func (ut *CreateLinkPayload) Validate() (err error)
Validate validates the CreateLinkPayload type instance.
type URL ¶
type URL struct { // URL ID ID *int `form:"id,omitempty" json:"id,omitempty" yaml:"id,omitempty" xml:"id,omitempty"` // URL path key Path *string `form:"path,omitempty" json:"path,omitempty" yaml:"path,omitempty" xml:"path,omitempty"` // External URL URL *string `form:"url,omitempty" json:"url,omitempty" yaml:"url,omitempty" xml:"url,omitempty"` }
A URL (default view)
Identifier: application/vnd.url+json; view=default
type UpdateLinkPayload ¶
type UpdateLinkPayload struct { Path string `form:"path" json:"path" yaml:"path" xml:"path"` URL string `form:"url" json:"url" yaml:"url" xml:"url"` }
UpdateLinkPayload user type.
func (*UpdateLinkPayload) Validate ¶
func (ut *UpdateLinkPayload) Validate() (err error)
Validate validates the UpdateLinkPayload type instance.