Versions in this module Expand all Collapse all v0 v0.2.711 Oct 17, 2026 v0.2.710 Oct 3, 2026 Changes in this version + const DefaultBaseURL + const DefaultMaxPages + const GraphQLPath + var DebugOut io.Writer = os.Stderr + var ErrReadOnly = errors.New("read-only mode") + var MaxResponseBytes int64 = 512 << 20 + var MaxRetries = 3 + var MaxRetryAfter = 30 * time.Second + var RetryBaseDelay = 500 * time.Millisecond + var RetryMaxDelay = 8 * time.Second + var SpecPagination func(method, path string) *Pagination + var Timeout = 30 * time.Second + func AllowedReadOnly(method, path string) bool + func BuildMultipart(fields []FormField) ([]byte, string, error) + func Debug() bool + func IsTimeout(err error) bool + func MatchTemplate(templates []string, path string) int + func Merge(pages []json.RawMessage) (json.RawMessage, error) + func NewHTTPClient() *http.Client + func NewTransport(next http.RoundTripper) http.RoundTripper + func ReadData(spec string, stdin io.Reader) ([]byte, error) + func ReadOnly() bool + func SetDebug(on bool) + func SetReadOnly(on bool) + type Client struct + BaseURL string + HTTP *http.Client + func New(token, baseURL string) *Client + func (c *Client) All(ctx context.Context, r Request, maxPages int) (*PageResult, error) + func (c *Client) Do(ctx context.Context, r Request) (*Response, error) + func (c *Client) GraphQL(ctx context.Context, query string, variables map[string]any) ([]byte, error) + func (c *Client) URL(path string, q url.Values) (string, error) + type Envelope struct + Errors []Message + Messages []Message + Result json.RawMessage + ResultInfo *ResultInfo + Success *bool + type Error struct + Errors []Message + Method string + Path string + Response *Response + Status int + func (e *Error) Error() string + type FormField struct + ContentType string + File string + FileName string + Name string + Value string + func ParseFormField(s string) (FormField, error) + type Message struct + Code int + Message string + type PageResult struct + Last *Response + Pages int + Result json.RawMessage + Style string + Truncated bool + type Pagination struct + BeforeParam string + CursorParam string + LimitParam string + OffsetParam string + PageParam string + SizeParam string + func PaginationFromParams(names []string) *Pagination + func (p *Pagination) IsZero() bool + type ReadOnlyError struct + Method string + Path string + func (e *ReadOnlyError) Error() string + func (e *ReadOnlyError) Unwrap() error + type Request struct + Body []byte + ContentType string + Header http.Header + Method string + Paging *Pagination + Path string + Query url.Values + type Response struct + Body []byte + ContentType string + Envelope *Envelope + Header http.Header + Status int + func (r *Response) IsJSON() bool + type ResultInfo struct + Count float64 + Cursor string + Cursors ... + Page float64 + PerPage float64 + TotalCount float64 + TotalPages float64 + func (ri *ResultInfo) NextCursor() string