Documentation
¶
Index ¶
- func New(endpoint, apiKey string) (_ api.Service, err error)
- type APIv1
- func (c *APIv1) DeleteShortURL(ctx context.Context, id string) (err error)
- func (s *APIv1) Do(req *http.Request, data interface{}, checkStatus bool) (rep *http.Response, err error)
- func (s *APIv1) NewRequest(ctx context.Context, method, path string, data interface{}, params *url.Values) (req *http.Request, err error)
- func (c *APIv1) ShortURLInfo(ctx context.Context, id string) (out *api.ShortURL, err error)
- func (c *APIv1) ShortURLList(ctx context.Context, page *api.PageQuery) (out *api.ShortURLList, err error)
- func (c *APIv1) ShortenURL(ctx context.Context, in *api.LongURL) (out *api.ShortURL, err error)
- func (c *APIv1) Status(ctx context.Context) (out *api.StatusReply, err error)
- func (c *APIv1) Updates(ctx context.Context, id string) (_ <-chan *api.Click, err error)
- type StatusError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIv1 ¶
type APIv1 struct {
// contains filtered or unexported fields
}
APIv1 implements the Service interface
func (*APIv1) DeleteShortURL ¶
func (*APIv1) Do ¶
func (s *APIv1) Do(req *http.Request, data interface{}, checkStatus bool) (rep *http.Response, err error)
Do executes an http request against the server, performs error checking, and deserializes the response data into the specified struct.
func (*APIv1) NewRequest ¶
func (*APIv1) ShortURLInfo ¶
func (*APIv1) ShortURLList ¶ added in v1.1.0
func (*APIv1) ShortenURL ¶
type StatusError ¶
type StatusError struct { StatusCode int Reply api.Reply }
StatusError decodes an error response from the Service
func (*StatusError) Error ¶
func (e *StatusError) Error() string
Click to show internal directories.
Click to hide internal directories.