Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsClientError ¶
IsClientError reports whether the error is a 4xx (excluding 404/429).
func IsNotFound ¶
IsNotFound reports whether the error is a 404 from the backend.
func IsRateLimited ¶
IsRateLimited reports whether the error is a 429.
Types ¶
type Client ¶
Client is a thin typed wrapper over net/http for the yank-run backend.
type CreateReq ¶
type CreateReq struct {
Body string `json:"body"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Author string `json:"author,omitempty"`
}
CreateReq is the body for POST /api/snippets.
type CreateResp ¶
CreateResp is the response from POST /api/snippets. New is derived from HTTP status: 201 -> true, 200 -> false (dedup).
type Hit ¶
type Hit struct {
ID string `json:"id"`
BodyPreview string `json:"bodyPreview"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags"`
Author string `json:"author,omitempty"`
CreatedAt int64 `json:"createdAt"`
}
Hit is one element of the GET /api/snippets?q=... search response.
type Snippet ¶
type Snippet struct {
ID string `json:"id"`
Body string `json:"body"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags"`
Author string `json:"author,omitempty"`
CreatedAt int64 `json:"createdAt"`
}
Snippet is the response from GET /api/snippets/:id.
Click to show internal directories.
Click to hide internal directories.