Documentation
¶
Overview ¶
Package bdds provides a Go client for the European Patent Office's Bulk Data Distribution Service (BDDS), covering product discovery, delivery listing, and downloading of bulk patent datasets such as DOCDB, INPADOC, and EP full-text.
Index ¶
- type AuthError
- type Client
- func (c *Client) DownloadFile(ctx context.Context, productID, deliveryID, fileID int, dst io.Writer) error
- func (c *Client) DownloadFileWithProgress(ctx context.Context, productID, deliveryID, fileID int, dst io.Writer, ...) error
- func (c *Client) GetLatestDelivery(ctx context.Context, productID int) (*Delivery, error)
- func (c *Client) GetProduct(ctx context.Context, productID int) (*ProductWithDeliveries, error)
- func (c *Client) GetProductByName(ctx context.Context, name string) (*Product, error)
- func (c *Client) ListProducts(ctx context.Context) ([]*Product, error)
- type Config
- type Delivery
- type DeliveryFile
- type NotFoundError
- type Product
- type ProductWithDeliveries
- type RateLimitError
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the main EPO BDDS API client
func NewClient ¶
NewClient creates a new EPO BDDS API client Authentication is optional - free products work without credentials, paid products require EPO BDDS subscription and authentication.
Example ¶
package main
import (
"fmt"
bdds "github.com/patent-dev/epo-bdds"
)
func main() {
// Credentials are optional: free/public products work without them,
// paid products require an EPO BDDS subscription.
client, err := bdds.NewClient(&bdds.Config{
Username: "your-epo-username",
Password: "your-epo-password",
})
if err != nil {
panic(err)
}
// client is ready; call ListProducts, GetProduct, DownloadFile, etc.
fmt.Println(client != nil)
}
Output: true
func (*Client) DownloadFile ¶
func (c *Client) DownloadFile(ctx context.Context, productID, deliveryID, fileID int, dst io.Writer) error
DownloadFile downloads a file to the provided writer
func (*Client) DownloadFileWithProgress ¶
func (c *Client) DownloadFileWithProgress(ctx context.Context, productID, deliveryID, fileID int, dst io.Writer, progressFn func(bytesWritten, totalBytes int64)) error
DownloadFileWithProgress downloads a file to the provided writer with progress callback
func (*Client) GetLatestDelivery ¶
GetLatestDelivery returns the most recent delivery for a product
func (*Client) GetProduct ¶
GetProduct returns detailed information about a specific product including deliveries
func (*Client) GetProductByName ¶
GetProductByName finds a product by name
type Config ¶
type Config struct {
Username string // EPO BDDS username
Password string // EPO BDDS password
BaseURL string // Base URL for API (default: https://publication-bdds.apps.epo.org)
UserAgent string // Optional custom user agent
MaxRetries int // Maximum number of retries (default: 3)
RetryDelay time.Duration // Delay between retries (default: 1s)
Timeout time.Duration // Request timeout (default: 30s)
}
Config holds client configuration
type Delivery ¶
type Delivery struct {
DeliveryID int
DeliveryName string
DeliveryPublicationDatetime time.Time
DeliveryExpiryDatetime *time.Time
Files []*DeliveryFile
}
Delivery represents a product delivery
type DeliveryFile ¶
type DeliveryFile struct {
FileID int
FileName string
FileSize string
FileChecksum string
FilePublicationDatetime time.Time
}
DeliveryFile represents a file in a delivery
type NotFoundError ¶
NotFoundError represents a resource not found error
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type ProductWithDeliveries ¶
ProductWithDeliveries represents a product with its deliveries
type RateLimitError ¶
type RateLimitError struct {
RetryAfter int // seconds
}
RateLimitError represents a rate limit error
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string