Documentation
¶
Index ¶
- func DecodeJSON(resp *http.Response, target interface{}) error
- func Paginate[T any](client *Client, path string, limit int) ([]T, error)
- func PaginateRaw(client *Client, path string, limit int) ([]json.RawMessage, error)
- func ValidateSlug(name, value string) error
- type APIError
- type Client
- func (c *Client) Delete(path string) (*http.Response, error)
- func (c *Client) Get(path string) (*http.Response, error)
- func (c *Client) GetURL(url string) (*http.Response, error)
- func (c *Client) Post(path string, body interface{}) (*http.Response, error)
- func (c *Client) Put(path string, body interface{}) (*http.Response, error)
- type PaginatedResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSON ¶
DecodeJSON reads a JSON response body into the target struct.
func Paginate ¶
Paginate fetches all pages of a paginated endpoint up to the given limit. If limit <= 0, all pages are fetched.
func PaginateRaw ¶
PaginateRaw fetches all pages and returns raw JSON messages for custom decoding.
func ValidateSlug ¶
ValidateSlug checks that a path segment is safe for URL interpolation.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Bitbucket API client.
func NewClient ¶
func NewClient(creds *auth.Credentials) *Client
NewClient creates a new API client with the given credentials.
Click to show internal directories.
Click to hide internal directories.