Documentation
¶
Overview ¶
Package productboard is a Go SDK for the ProductBoard REST API v2 (https://developer.productboard.com/reference/introduction). ProductBoard publishes an official OpenAPI spec, vendored at openapi/entities.json (see openapi/SOURCE.md for provenance) and used to generate internal/api via ogen — see generate.sh / make generate.
Scope is deliberately thin for v0.1: read-only access to Features, Releases, and Objectives via ProductBoard's generic Entities API, just enough to back an github.com/grokify/omniroadmap-core Provider adapter (see the omniroadmap/ subpackage). Full CRUD across ProductBoard's other APIs (Notes, Teams, Members, Webhooks, Analytics, Integrations) is out of scope until there's real need for it.
Index ¶
- Constants
- Variables
- func IsNotFound(err error) bool
- func IsRateLimited(err error) bool
- func IsUnauthorized(err error) bool
- type APIError
- type Client
- func (c *Client) API() *api.Client
- func (c *Client) BaseURL() string
- func (c *Client) GetFeature(ctx context.Context, id string) (*Feature, error)
- func (c *Client) GetObjective(ctx context.Context, id string) (*Objective, error)
- func (c *Client) GetRelease(ctx context.Context, id string) (*Release, error)
- func (c *Client) ListFeatures(ctx context.Context, opts ...ListOption) (*FeatureList, error)
- func (c *Client) ListObjectives(ctx context.Context, opts ...ListOption) (*ObjectiveList, error)
- func (c *Client) ListReleases(ctx context.Context, opts ...ListOption) (*ReleaseList, error)
- type Config
- type Feature
- type FeatureList
- type ListOption
- type ListOptions
- type Member
- type Objective
- type ObjectiveList
- type Option
- type Release
- type ReleaseList
- type SelectOption
- type Status
- type Timeframe
Constants ¶
const ( // SDKVersion is the version of this SDK. SDKVersion = "0.1.0" // SDKName is the name of this SDK. SDKName = "productboard-go" )
Variables ¶
var (
ErrMissingAPIToken = errors.New("productboard: api token is required")
)
Sentinel errors for configuration and validation.
Functions ¶
func IsNotFound ¶
IsNotFound returns true if the error indicates a 404 Not Found response.
func IsRateLimited ¶
IsRateLimited returns true if the error indicates a 429 Too Many Requests response.
func IsUnauthorized ¶
IsUnauthorized returns true if the error indicates a 401 Unauthorized response.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides access to the ProductBoard API.
func NewClient ¶
NewClient creates a new ProductBoard client with the given options.
Configuration is loaded in the following order (later values override earlier ones): defaults, PRODUCTBOARD_API_TOKEN environment variable, options passed to NewClient.
func (*Client) API ¶
API returns the low-level ogen-generated client for advanced use, for API operations not covered by the high-level wrapper.
func (*Client) GetFeature ¶
GetFeature retrieves a feature (or subfeature) by ID.
func (*Client) GetObjective ¶
GetObjective retrieves an objective by ID.
func (*Client) GetRelease ¶
GetRelease retrieves a release by ID.
func (*Client) ListFeatures ¶
func (c *Client) ListFeatures(ctx context.Context, opts ...ListOption) (*FeatureList, error)
ListFeatures lists features and subfeatures.
func (*Client) ListObjectives ¶
func (c *Client) ListObjectives(ctx context.Context, opts ...ListOption) (*ObjectiveList, error)
ListObjectives lists objectives.
func (*Client) ListReleases ¶
func (c *Client) ListReleases(ctx context.Context, opts ...ListOption) (*ReleaseList, error)
ListReleases lists releases.
type Config ¶
type Config struct {
// APIToken is your ProductBoard API token (Personal Access Token).
APIToken string
// HTTPClient is the HTTP client to use for requests. If nil, a new
// *http.Client with Timeout applied is constructed. If set, it's used
// as-is — Timeout is not applied to a caller-supplied client.
HTTPClient *http.Client
// Timeout is the request timeout. Default is 60 seconds.
Timeout time.Duration
// BaseURL overrides the default API URL. If empty, defaultBaseURL is used.
BaseURL string
}
Config holds the configuration for the Client.
type Feature ¶
type Feature struct {
ID string
Type string // "feature" or "subfeature"
Name string
Description string
Status *Status
Owner *Member
Tags []SelectOption
Timeframe *Timeframe
ParentID string // component/feature this belongs to, if any
Archived bool
CreatedAt *time.Time
UpdatedAt *time.Time
}
Feature represents a ProductBoard feature or subfeature.
type FeatureList ¶
FeatureList is a page of features, with a cursor for the next page.
type ListOption ¶
type ListOption func(*ListOptions)
ListOption configures a list operation.
func WithNameFilter ¶
func WithNameFilter(name string) ListOption
WithNameFilter filters results by entity name.
func WithPageCursor ¶
func WithPageCursor(cursor string) ListOption
WithPageCursor sets the pagination cursor (from a previous ListResult's NextCursor).
type ListOptions ¶
ListOptions configures list operations. ProductBoard's Entities API uses cursor-based pagination, not page numbers — PageCursor comes from the previous response's NextCursor.
type Objective ¶
type Objective struct {
ID string
Name string
Description string
Status *Status
Owner *Member
Timeframe *Timeframe
Archived bool
CreatedAt *time.Time
UpdatedAt *time.Time
}
Objective represents a ProductBoard objective (OKR-style goal).
type ObjectiveList ¶
ObjectiveList is a page of objectives, with a cursor for the next page.
type Option ¶
type Option func(*Config)
Option configures the Client.
func WithAPIToken ¶
WithAPIToken sets the ProductBoard API token.
func WithBaseURL ¶
WithBaseURL overrides the default API URL.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.
func WithTimeout ¶
WithTimeout sets the request timeout.
type Release ¶
type Release struct {
ID string
Name string
Status *Status
Timeframe *Timeframe
Archived bool
CreatedAt *time.Time
UpdatedAt *time.Time
}
Release represents a ProductBoard release.
type ReleaseList ¶
ReleaseList is a page of releases, with a cursor for the next page.
type SelectOption ¶
SelectOption is a single value from a single/multi-select custom field.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
api
Code generated by ogen, DO NOT EDIT.
|
Code generated by ogen, DO NOT EDIT. |
|
Package omniroadmap implements omniroadmap-core's provider.Provider for ProductBoard, wrapping productboard-go's own *productboard.Client.
|
Package omniroadmap implements omniroadmap-core's provider.Provider for ProductBoard, wrapping productboard-go's own *productboard.Client. |