Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsuccessfulReply = Reply{Success: false} ErrNotFoundReply = Reply{Success: false, Error: "resource not found"} ErrNotAllowedReply = Reply{Success: false, Error: "method not allowed"} ErrUnparsable = Reply{Success: false, Error: "could not parse json request"} )
View Source
var ( ErrMissingURL = errors.New("a url is required for shortening") ErrCannotParseExpires = errors.New("expires must be a timestamp in the form of YYYY-MM-DD or YYYY-MM-DD HH:MM:SS") ErrInvalidExpires = errors.New("expiration must be valid timestamp in the future") ErrParseBearer = errors.New("could not parse Bearer token from Authorization header") ErrNoAuthorization = errors.New("no authorization header in request") ErrInvalidToken = errors.New("invalid bearer token in Authorization header") ErrUnauthenticated = errors.New("this endpoint requires authentication") )
Functions ¶
This section is empty.
Types ¶
type PageQuery ¶
type PageQuery struct {
PageSize int `json:"page_size" url:"page_size,omitempty" form:"page_size"`
NextPageToken string `json:"next_page_token" url:"next_page_token,omitempty" form:"next_page_token"`
}
PageQuery manages paginated list requests.
type Reply ¶
Reply contains standard fields that are used for generic API responses and errors.
func ErrorResponse ¶
func ErrorResponse(err interface{}) Reply
Construct a new response for an error or simply return unsuccessful.
type StatusReply ¶
type StatusReply struct {
Status string `json:"status"`
Uptime string `json:"uptime,omitempty"`
Version string `json:"version,omitempty"`
}
Returned on status requests.
Click to show internal directories.
Click to hide internal directories.