Versions in this module Expand all Collapse all v0 v0.1.0 Nov 15, 2026 Changes in this version + const DefaultBaseURL + const MaxObjectBytes + const Version + var ErrAuthentication = errors.New("privconvert: missing, invalid or revoked API key") + var ErrBadRequest = errors.New("privconvert: bad request") + var ErrConcurrencyLimit = errors.New("privconvert: too many conversions running at once") + var ErrConversionFailed = errors.New("privconvert: the file was read but could not be converted") + var ErrFileTooLarge = errors.New("privconvert: file is above your plan's size limit") + var ErrJobExpired = errors.New("privconvert: job result passed its retention window") + var ErrJobNotFound = errors.New("privconvert: job not found") + var ErrRateLimit = errors.New("privconvert: per-minute rate or monthly quota exceeded") + var ErrServer = errors.New("privconvert: server error") + var ErrStorage = errors.New("privconvert: reading from or writing to cloud storage failed") + var ErrUnsupportedType = errors.New("privconvert: input file type is not valid for this tool") + var ErrWebhook = errors.New("privconvert: webhook signature verification failed") + func VerifyWebhook(jobKey, signature string, rawBody []byte) error + func VerifyWebhookAt(jobKey, signature string, rawBody []byte, now time.Time, ...) error + type Client struct + func New(opts ...Option) (*Client, error) + func (c *Client) Convert(ctx context.Context, tool string, f File, params Params) (*Result, error) + func (c *Client) ConvertBatch(ctx context.Context, tool string, files []File, params Params) (*Result, error) + func (c *Client) ConvertFile(ctx context.Context, tool, path string, params Params) (*Result, error) + func (c *Client) ConvertStorage(ctx context.Context, store Storage, tool, source, destination string, ...) (*Result, error) + func (c *Client) DeleteJob(ctx context.Context, jobID string) error + func (c *Client) DownloadJob(ctx context.Context, job *Job) (*Result, error) + func (c *Client) GetJob(ctx context.Context, jobID string) (*JobStatus, error) + func (c *Client) GoString() string + func (c *Client) Me(ctx context.Context) (map[string]any, error) + func (c *Client) String() string + func (c *Client) SubmitJob(ctx context.Context, tool string, f File, opts *JobOptions) (*Job, error) + func (c *Client) Tools(ctx context.Context, category string) ([]map[string]any, error) + func (c *Client) Wait(ctx context.Context, job *Job, opts *WaitOptions) (*Result, error) + type Error struct + Code string + Kind error + Message string + RetryAfter time.Duration + Status int + func StorageError(msg, code string) *Error + func (e *Error) Error() string + func (e *Error) Is(target error) bool + func (e *Error) Unwrap() error + type File struct + Data []byte + Name string + func ReadFile(path string) (File, error) + func (f File) GoString() string + func (f File) String() string + type Job struct + ID string + Key string + Status string + func (j Job) GoString() string + func (j Job) String() string + type JobOptions struct + Params Params + WebhookURL string + type JobStatus struct + ID string + Raw map[string]any + Status string + func (s *JobStatus) Done() bool + func (s *JobStatus) ErrorInfo() map[string]any + type Location struct + Account string + Bucket string + Key string + Provider string + func ParseLocation(s string) (Location, error) + func (l Location) String() string + type Option func(*Client) error + func WithAPIKey(key string) Option + func WithBaseURL(u string) Option + func WithHTTPClient(h *http.Client) Option + func WithMaxRetries(n int) Option + func WithTimeout(d time.Duration) Option + type Params map[string]any + type Result struct + Content []byte + ContentType string + Filename string + Header http.Header + func (r *Result) ConvertedCount() (int, bool) + func (r *Result) CreditsRemaining() (int, bool) + func (r *Result) FailedCount() int + func (r *Result) Partial() bool + func (r *Result) SanitizeReport() map[string]any + func (r *Result) Save(path string) error + func (r *Result) String() string + type Storage interface + Exists func(ctx context.Context, loc Location) (bool, error) + Read func(ctx context.Context, loc Location) ([]byte, error) + Write func(ctx context.Context, loc Location, data []byte, contentType string, ...) error + type StorageOptions struct + NoOverwrite bool + Params Params + type WaitOptions struct + KeepResult bool + PollInterval time.Duration + Timeout time.Duration